From 0abf068ad1a8021261f915f4cba426f2ef24ed16 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 3 Oct 2024 16:54:03 +0000 Subject: [PATCH] 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. --- lightning/src/offers/parse.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.39.5