]> git.bitcoin.ninja Git - rust-lightning/commit
Drop panic if `rust-bitcoin` adds a new `Network`
authorMatt Corallo <git@bluematt.me>
Sun, 26 Nov 2023 19:07:10 +0000 (19:07 +0000)
committerMatt Corallo <git@bluematt.me>
Sun, 26 Nov 2023 19:07:10 +0000 (19:07 +0000)
commitb28068cc42882631799696b144d343686d2c3ebc
treeab26cd09e331b02aa0d0d6c6eb6d74c498b30a36
parent70ea1108646468335d085a862e18bca774632bf3
Drop panic if `rust-bitcoin` adds a new `Network`

`rust-bitcoin` 0.30 added `#[non_exhaustive]` to the `Network`
enum, allowing them to "add support" for a new network type without
a major version change in the future. When upgrading, we added a
simple `unreachable` for the general match arm, which would break
in a minor version change of `rust-bitcoin`.

While it seems [possible rust-bitcoin will change
this](https://github.com/rust-bitcoin/rust-bitcoin/issues/2225),
we still shouldn't ba panicking, which we drop here in favor of a
`debug_assert`ion, and a default value.
lightning-invoice/src/lib.rs