diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-02-21 11:40:53 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-02-21 11:40:53 +0100 |
commit | 84d5730b7029ef8502571ec7a861442ed67ef934 (patch) | |
tree | 143a37af03f8a86a4bb94d8774882a614d75e607 | |
parent | ca01844dcb5f86dae8d4320dd6e1317914e55dcd (diff) |
openpgp: Mark enum SignatureType as non-exhaustive.
-rw-r--r-- | openpgp/src/types/mod.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/openpgp/src/types/mod.rs b/openpgp/src/types/mod.rs index 2c567973..0352ba6e 100644 --- a/openpgp/src/types/mod.rs +++ b/openpgp/src/types/mod.rs @@ -867,6 +867,10 @@ pub enum SignatureType { /// Catchall. Unknown(u8), + + /// This marks this enum as non-exhaustive. Do not use this + /// variant. + #[doc(hidden)] __Nonexhaustive, } impl From<u8> for SignatureType { @@ -911,6 +915,7 @@ impl From<SignatureType> for u8 { SignatureType::Timestamp => 0x40, SignatureType::Confirmation => 0x50, SignatureType::Unknown(u) => u, + SignatureType::__Nonexhaustive => unreachable!(), } } } @@ -950,6 +955,7 @@ impl fmt::Display for SignatureType { f.write_str("Confirmation"), SignatureType::Unknown(u) => f.write_fmt(format_args!("Unknown signature type 0x{:x}", u)), + SignatureType::__Nonexhaustive => unreachable!(), } } } |