Skip to content

Commit b15f3f7

Browse files
committed
f Compare iter instead of allocating String
1 parent c5f6077 commit b15f3f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lightning/src/offers/parse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ mod sealed {
5858

5959
let parsed = CheckedHrpstring::new::<NoChecksum>(encoded.as_ref())?;
6060
let hrp = parsed.hrp();
61-
if (hrp.as_str() != Self::BECH32_HRP) && (hrp.as_str().to_lowercase() != Self::BECH32_HRP) {
61+
if (hrp.as_str() != Self::BECH32_HRP) && hrp.lowercase_char_iter().ne(Self::BECH32_HRP.chars()) {
6262
return Err(Bolt12ParseError::InvalidBech32Hrp);
6363
}
6464

0 commit comments

Comments
 (0)