From 43b684bbe609f993a36780736cd9fa8a6f533965 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 26 May 2022 11:47:33 +1000 Subject: [PATCH] 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. --- src/util/address.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/address.rs b/src/util/address.rs index afa4c714..51b3751a 100644 --- a/src/util/address.rs +++ b/src/util/address.rs @@ -139,6 +139,7 @@ impl From 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,