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 {
71
71
"PaymentSecret::from_base32()" . into ( ) ,
72
72
) ) ;
73
73
}
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) )
78
76
}
79
77
}
80
78
Original file line number Diff line number Diff line change @@ -128,8 +128,8 @@ impl Base32Iterable for Bolt11InvoiceFeatures {
128
128
129
129
impl Base32Len for Bolt11InvoiceFeatures {
130
130
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 ( )
133
133
}
134
134
}
135
135
You can’t perform that action at this time.
0 commit comments