From 78785279c6b26b062efed2504bdf3be6503484c3 Mon Sep 17 00:00:00 2001 From: Zeeshan Ali Date: Fri, 7 Oct 2022 15:58:38 +0200 Subject: [PATCH] Declare open-ended enum types as non-exhaustive So that future variant additions don't require API break. --- src/types.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/types.rs b/src/types.rs index a9c897b..ba6ebe2 100644 --- a/src/types.rs +++ b/src/types.rs @@ -289,6 +289,7 @@ impl AtomOrQuoted { #[cfg_attr(feature = "serdex", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq, Eq)] +#[non_exhaustive] pub enum Response { Greeting { domain: String, @@ -409,6 +410,7 @@ impl Response { #[cfg_attr(feature = "serdex", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq, Eq)] +#[non_exhaustive] pub enum Capability { // Send as mail [RFC821] // The description of SEND was updated by [RFC1123] and then its actual use was deprecated in [RFC2821] @@ -591,6 +593,7 @@ impl Capability { #[cfg_attr(feature = "serdex", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq, Eq)] +#[non_exhaustive] pub enum AuthMechanism { Plain, Login,