File tree 6 files changed +8
-17
lines changed
6 files changed +8
-17
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ fn main() -> Result<(), Box<dyn Error>> {
85
85
86
86
let network = matches
87
87
. value_of ( "network" )
88
- . map ( |n| Network :: from_str ( n ) )
88
+ . map ( Network :: from_str)
89
89
. transpose ( )
90
90
. unwrap ( )
91
91
. unwrap_or ( Network :: Testnet ) ;
Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ macro_rules! impl_inner_method {
108
108
/// It allows switching backend at runtime
109
109
///
110
110
/// 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
111
112
pub enum AnyBlockchain {
112
113
#[ cfg( feature = "electrum" ) ]
113
114
#[ cfg_attr( docsrs, doc( cfg( feature = "electrum" ) ) ) ]
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ pub struct Peer {
115
115
writer : Arc < Mutex < TcpStream > > ,
116
116
responses : Arc < RwLock < ResponsesMap > > ,
117
117
118
- reader_thread : thread:: JoinHandle < ( ) > ,
118
+ _reader_thread : thread:: JoinHandle < ( ) > ,
119
119
connected : Arc < RwLock < bool > > ,
120
120
121
121
mempool : Arc < Mempool > ,
@@ -228,7 +228,7 @@ impl Peer {
228
228
Ok ( Peer {
229
229
writer,
230
230
responses,
231
- reader_thread,
231
+ _reader_thread : reader_thread,
232
232
connected,
233
233
mempool,
234
234
version,
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ pub struct RpcBlockchain {
55
55
/// Rpc client to the node, includes the wallet name
56
56
client : Client ,
57
57
/// Network used
58
- network : Network ,
58
+ _network : Network ,
59
59
/// Blockchain capabilities, cached here at startup
60
60
capabilities : HashSet < Capability > ,
61
61
/// 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 {
405
405
406
406
Ok ( RpcBlockchain {
407
407
client,
408
- network,
408
+ _network : network,
409
409
capabilities,
410
410
_storage_address : storage_address,
411
411
skip_blocks : config. skip_blocks ,
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ impl FromStr for WalletExport {
96
96
}
97
97
98
98
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 ) )
100
100
}
101
101
102
102
impl WalletExport {
Original file line number Diff line number Diff line change @@ -448,7 +448,7 @@ impl SignersContainer {
448
448
/// Options for a software signer
449
449
///
450
450
/// Adjust the behavior of our software signers and the way a transaction is finalized
451
- #[ derive( Debug , Clone ) ]
451
+ #[ derive( Debug , Clone , Default ) ]
452
452
pub struct SignOptions {
453
453
/// Whether the signer should trust the `witness_utxo`, if the `non_witness_utxo` hasn't been
454
454
/// provided
@@ -479,16 +479,6 @@ pub struct SignOptions {
479
479
pub allow_all_sighashes : bool ,
480
480
}
481
481
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
-
492
482
pub ( crate ) trait ComputeSighash {
493
483
fn sighash (
494
484
psbt : & psbt:: PartiallySignedTransaction ,
You can’t perform that action at this time.
0 commit comments