]> git.bitcoin.ninja Git - rust-lightning/commit
Marginally reduce allocations in `lightning-invoice`
authorMatt Corallo <git@bluematt.me>
Thu, 3 Oct 2024 16:54:14 +0000 (16:54 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 3 Oct 2024 17:26:01 +0000 (17:26 +0000)
commit052e7c3df06012e0787b65b11d740843e26c3c1a
tree8721e92fb0f05968b752522b086bf8fceb05967b
parentc5658f6cc2cfa6eee2a45d206b08933d30f1a275
Marginally reduce allocations in `lightning-invoice`

In aa2f6b47df312f026213d0ceaaff20ffe955c377 we refactored
`lightning-invoice` de/serialization to use the new version of
`bech32`, but in order to keep the public API the same we
introduced one allocation we could have skipped.

Instead, here, we replace the public `Utf8Error` with
`FromUtf8Error` which contains the original data which failed
conversion, removing an allocation in the process.
lightning-invoice/src/de.rs
lightning-invoice/src/lib.rs