File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -71,10 +71,8 @@ impl FromBase32 for PaymentSecret {
7171 "PaymentSecret::from_base32()" . into ( ) ,
7272 ) ) ;
7373 }
74- let data_bytes = Vec :: < u8 > :: from_base32 ( field_data) ?;
75- let mut payment_secret = [ 0 ; 32 ] ;
76- payment_secret. copy_from_slice ( & data_bytes) ;
77- Ok ( PaymentSecret ( payment_secret) )
74+ let data_bytes = <[ u8 ; 32 ] >:: from_base32 ( field_data) ?;
75+ Ok ( PaymentSecret ( data_bytes) )
7876 }
7977}
8078
Original file line number Diff line number Diff line change @@ -128,8 +128,8 @@ impl Base32Iterable for Bolt11InvoiceFeatures {
128128
129129impl Base32Len for Bolt11InvoiceFeatures {
130130 fn base32_len ( & self ) -> usize {
131- // Here we actually do the conversion
132- self . fe_iter ( ) . collect :: < Vec < Fe32 > > ( ) . len ( )
131+ // Here we perform the real conversion, due to trimming it's hard to estimate
132+ self . fe_iter ( ) . count ( )
133133 }
134134}
135135
You can’t perform that action at this time.
0 commit comments