Skip to content

Commit ba35470

Browse files
committed
Add non_exhaustive compiler directive to AddressType
Currently adding variants to enums is a breaking change. In an effort to reduce the upgrade burden on users we can use the `non_exhaustive` compiler directive so that adding a new variant does not cause downstream code to break. Add `non_exhaustive` to the `AddressType` since it may be extended in the future.
1 parent 1090495 commit ba35470

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/util/address.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ impl From<bech32::Error> for Error {
139139

140140
/// The different types of addresses.
141141
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
142+
#[non_exhaustive]
142143
pub enum AddressType {
143144
/// Pay to pubkey hash.
144145
P2pkh,

0 commit comments

Comments
 (0)