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.
This commit is contained in:
Tobin C. Harding 2022-05-26 11:47:33 +10:00
parent 324fa0f7be
commit 43b684bbe6
1 changed files with 1 additions and 0 deletions

View File

@ -139,6 +139,7 @@ impl From<bech32::Error> for Error {
/// The different types of addresses.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[non_exhaustive]
pub enum AddressType {
/// Pay to pubkey hash.
P2pkh,