From: Matt Corallo Date: Thu, 3 Oct 2024 16:54:03 +0000 (+0000) Subject: Drop one unnecessary allocation added in aa2f6b47df312f026213d0ceaa X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=0abf068ad1a8021261f915f4cba426f2ef24ed16;p=rust-lightning Drop one unnecessary allocation added in aa2f6b47df312f026213d0ceaa In aa2f6b47df312f026213d0ceaaff20ffe955c377 we refactored `lightning-invoice` de/serialization to use the new version of `bech32`, but ended up adding one unnecessary allocation in our offers logic, which we drop here. --- diff --git a/lightning/src/offers/parse.rs b/lightning/src/offers/parse.rs index a46e90de6..7c9d80387 100644 --- a/lightning/src/offers/parse.rs +++ b/lightning/src/offers/parse.rs @@ -58,7 +58,7 @@ mod sealed { let parsed = CheckedHrpstring::new::(encoded.as_ref())?; let hrp = parsed.hrp(); - if hrp.to_string() != Self::BECH32_HRP { + if hrp.as_str() != Self::BECH32_HRP { return Err(Bolt12ParseError::InvalidBech32Hrp); }