@@ -585,13 +585,13 @@ impl<D: tb::Bool, H: tb::Bool, C: tb::Bool, S: tb::Bool> InvoiceBuilder<D, H, tb
585585 } ) . collect :: < Vec < _ > > ( ) ;
586586
587587 let data = RawDataPart {
588- timestamp : timestamp ,
589- tagged_fields : tagged_fields ,
588+ timestamp,
589+ tagged_fields,
590590 } ;
591591
592592 Ok ( RawInvoice {
593- hrp : hrp ,
594- data : data ,
593+ hrp,
594+ data,
595595 } )
596596 }
597597}
@@ -781,7 +781,7 @@ impl SignedRawInvoice {
781781 recovered_pub_key = Some ( recovered) ;
782782 }
783783
784- let pub_key = included_pub_key. or_else ( || recovered_pub_key. as_ref ( ) )
784+ let pub_key = included_pub_key. or ( recovered_pub_key. as_ref ( ) )
785785 . expect ( "One is always present" ) ;
786786
787787 let hash = Message :: from_slice ( & self . hash [ ..] )
@@ -1014,9 +1014,9 @@ impl PositiveTimestamp {
10141014}
10151015
10161016#[ cfg( feature = "std" ) ]
1017- impl Into < SystemTime > for PositiveTimestamp {
1018- fn into ( self ) -> SystemTime {
1019- SystemTime :: UNIX_EPOCH + self . 0
1017+ impl From < PositiveTimestamp > for SystemTime {
1018+ fn from ( val : PositiveTimestamp ) -> Self {
1019+ SystemTime :: UNIX_EPOCH + val . 0
10201020 }
10211021}
10221022
@@ -1147,7 +1147,7 @@ impl Invoice {
11471147 /// ```
11481148 pub fn from_signed ( signed_invoice : SignedRawInvoice ) -> Result < Self , SemanticError > {
11491149 let invoice = Invoice {
1150- signed_invoice : signed_invoice ,
1150+ signed_invoice,
11511151 } ;
11521152 invoice. check_field_counts ( ) ?;
11531153 invoice. check_feature_bits ( ) ?;
@@ -1185,9 +1185,9 @@ impl Invoice {
11851185 ///
11861186 /// (C-not exported) because we don't yet export InvoiceDescription
11871187 pub fn description ( & self ) -> InvoiceDescription {
1188- if let Some ( ref direct) = self . signed_invoice . description ( ) {
1188+ if let Some ( direct) = self . signed_invoice . description ( ) {
11891189 return InvoiceDescription :: Direct ( direct) ;
1190- } else if let Some ( ref hash) = self . signed_invoice . description_hash ( ) {
1190+ } else if let Some ( hash) = self . signed_invoice . description_hash ( ) {
11911191 return InvoiceDescription :: Hash ( hash) ;
11921192 }
11931193 unreachable ! ( "ensured by constructor" ) ;
@@ -1332,9 +1332,9 @@ impl Description {
13321332 }
13331333}
13341334
1335- impl Into < String > for Description {
1336- fn into ( self ) -> String {
1337- self . into_inner ( )
1335+ impl From < Description > for String {
1336+ fn from ( val : Description ) -> Self {
1337+ val . into_inner ( )
13381338 }
13391339}
13401340
@@ -1398,9 +1398,9 @@ impl PrivateRoute {
13981398 }
13991399}
14001400
1401- impl Into < RouteHint > for PrivateRoute {
1402- fn into ( self ) -> RouteHint {
1403- self . into_inner ( )
1401+ impl From < PrivateRoute > for RouteHint {
1402+ fn from ( val : PrivateRoute ) -> Self {
1403+ val . into_inner ( )
14041404 }
14051405}
14061406
@@ -1766,7 +1766,7 @@ mod test {
17661766
17671767 // Multiple payment secrets
17681768 let invoice = {
1769- let mut invoice = invoice_template. clone ( ) ;
1769+ let mut invoice = invoice_template;
17701770 invoice. data . tagged_fields . push ( PaymentSecret ( payment_secret) . into ( ) ) ;
17711771 invoice. data . tagged_fields . push ( PaymentSecret ( payment_secret) . into ( ) ) ;
17721772 invoice. sign :: < _ , ( ) > ( |hash| Ok ( Secp256k1 :: new ( ) . sign_ecdsa_recoverable ( hash, & private_key) ) )
@@ -1792,7 +1792,7 @@ mod test {
17921792 assert_eq ! ( invoice. hrp. raw_amount, Some ( 15 ) ) ;
17931793
17941794
1795- let invoice = builder. clone ( )
1795+ let invoice = builder
17961796 . amount_milli_satoshis ( 150 )
17971797 . build_raw ( )
17981798 . unwrap ( ) ;
@@ -1846,7 +1846,7 @@ mod test {
18461846 . build_raw ( ) ;
18471847 assert_eq ! ( long_route_res, Err ( CreationError :: RouteTooLong ) ) ;
18481848
1849- let sign_error_res = builder. clone ( )
1849+ let sign_error_res = builder
18501850 . description ( "Test" . into ( ) )
18511851 . payment_secret ( PaymentSecret ( [ 0 ; 32 ] ) )
18521852 . try_build_signed ( |_| {
@@ -1876,7 +1876,7 @@ mod test {
18761876
18771877 let route_1 = RouteHint ( vec ! [
18781878 RouteHintHop {
1879- src_node_id: public_key. clone ( ) ,
1879+ src_node_id: public_key,
18801880 short_channel_id: de:: parse_int_be( & [ 123 ; 8 ] , 256 ) . expect( "short chan ID slice too big?" ) ,
18811881 fees: RoutingFees {
18821882 base_msat: 2 ,
@@ -1887,7 +1887,7 @@ mod test {
18871887 htlc_maximum_msat: None ,
18881888 } ,
18891889 RouteHintHop {
1890- src_node_id: public_key. clone ( ) ,
1890+ src_node_id: public_key,
18911891 short_channel_id: de:: parse_int_be( & [ 42 ; 8 ] , 256 ) . expect( "short chan ID slice too big?" ) ,
18921892 fees: RoutingFees {
18931893 base_msat: 3 ,
@@ -1901,7 +1901,7 @@ mod test {
19011901
19021902 let route_2 = RouteHint ( vec ! [
19031903 RouteHintHop {
1904- src_node_id: public_key. clone ( ) ,
1904+ src_node_id: public_key,
19051905 short_channel_id: 0 ,
19061906 fees: RoutingFees {
19071907 base_msat: 4 ,
@@ -1912,7 +1912,7 @@ mod test {
19121912 htlc_maximum_msat: None ,
19131913 } ,
19141914 RouteHintHop {
1915- src_node_id: public_key. clone ( ) ,
1915+ src_node_id: public_key,
19161916 short_channel_id: de:: parse_int_be( & [ 1 ; 8 ] , 256 ) . expect( "short chan ID slice too big?" ) ,
19171917 fees: RoutingFees {
19181918 base_msat: 5 ,
@@ -1927,7 +1927,7 @@ mod test {
19271927 let builder = InvoiceBuilder :: new ( Currency :: BitcoinTestnet )
19281928 . amount_milli_satoshis ( 123 )
19291929 . duration_since_epoch ( Duration :: from_secs ( 1234567 ) )
1930- . payee_pub_key ( public_key. clone ( ) )
1930+ . payee_pub_key ( public_key)
19311931 . expiry_time ( Duration :: from_secs ( 54321 ) )
19321932 . min_final_cltv_expiry_delta ( 144 )
19331933 . fallback ( Fallback :: PubKeyHash ( [ 0 ; 20 ] ) )
0 commit comments