Skip to content

Commit e1201ae

Browse files
committed
Fix rust stable (1.58.1) clippy errors
1 parent ef1e19e commit e1201ae

File tree

6 files changed

+8
-17
lines changed

6 files changed

+8
-17
lines changed

examples/compiler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ fn main() -> Result<(), Box<dyn Error>> {
8585

8686
let network = matches
8787
.value_of("network")
88-
.map(|n| Network::from_str(n))
88+
.map(Network::from_str)
8989
.transpose()
9090
.unwrap()
9191
.unwrap_or(Network::Testnet);

src/blockchain/any.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ macro_rules! impl_inner_method {
108108
/// It allows switching backend at runtime
109109
///
110110
/// See [this module](crate::blockchain::any)'s documentation for a usage example.
111+
#[allow(clippy::large_enum_variant)] // TODO fix, see https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
111112
pub enum AnyBlockchain {
112113
#[cfg(feature = "electrum")]
113114
#[cfg_attr(docsrs, doc(cfg(feature = "electrum")))]

src/blockchain/compact_filters/peer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ pub struct Peer {
115115
writer: Arc<Mutex<TcpStream>>,
116116
responses: Arc<RwLock<ResponsesMap>>,
117117

118-
reader_thread: thread::JoinHandle<()>,
118+
_reader_thread: thread::JoinHandle<()>,
119119
connected: Arc<RwLock<bool>>,
120120

121121
mempool: Arc<Mempool>,
@@ -228,7 +228,7 @@ impl Peer {
228228
Ok(Peer {
229229
writer,
230230
responses,
231-
reader_thread,
231+
_reader_thread: reader_thread,
232232
connected,
233233
mempool,
234234
version,

src/blockchain/rpc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub struct RpcBlockchain {
5555
/// Rpc client to the node, includes the wallet name
5656
client: Client,
5757
/// Network used
58-
network: Network,
58+
_network: Network,
5959
/// Blockchain capabilities, cached here at startup
6060
capabilities: HashSet<Capability>,
6161
/// Skip this many blocks of the blockchain at the first rescan, if None the rescan is done from the genesis block
@@ -405,7 +405,7 @@ impl ConfigurableBlockchain for RpcBlockchain {
405405

406406
Ok(RpcBlockchain {
407407
client,
408-
network,
408+
_network: network,
409409
capabilities,
410410
_storage_address: storage_address,
411411
skip_blocks: config.skip_blocks,

src/wallet/export.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl FromStr for WalletExport {
9696
}
9797

9898
fn remove_checksum(s: String) -> String {
99-
s.splitn(2, '#').next().map(String::from).unwrap()
99+
String::from(s.split_once('#').map_or(&*s, |x| x.0))
100100
}
101101

102102
impl WalletExport {

src/wallet/signer.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ impl SignersContainer {
448448
/// Options for a software signer
449449
///
450450
/// Adjust the behavior of our software signers and the way a transaction is finalized
451-
#[derive(Debug, Clone)]
451+
#[derive(Debug, Clone, Default)]
452452
pub struct SignOptions {
453453
/// Whether the signer should trust the `witness_utxo`, if the `non_witness_utxo` hasn't been
454454
/// provided
@@ -479,16 +479,6 @@ pub struct SignOptions {
479479
pub allow_all_sighashes: bool,
480480
}
481481

482-
impl Default for SignOptions {
483-
fn default() -> Self {
484-
SignOptions {
485-
trust_witness_utxo: false,
486-
assume_height: None,
487-
allow_all_sighashes: false,
488-
}
489-
}
490-
}
491-
492482
pub(crate) trait ComputeSighash {
493483
fn sighash(
494484
psbt: &psbt::PartiallySignedTransaction,

0 commit comments

Comments
 (0)