diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-02-21 11:44:07 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-02-21 11:44:07 +0100 |
commit | 73ddf1d6a8c5c4386d5fc906fe38eb47d7ffcc13 (patch) | |
tree | cf8db00ad6b98e32e11b9354c559a98c28c68fd1 | |
parent | 68479cab1e5939ab49894ee8c1d7a0c6ecd5fb5e (diff) |
openpgp: Mark enum DataFormat 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 65255f23..fffabaf1 100644 --- a/openpgp/src/types/mod.rs +++ b/openpgp/src/types/mod.rs @@ -1140,6 +1140,10 @@ pub enum DataFormat { /// Unknown format specifier. Unknown(char), + + /// This marks this enum as non-exhaustive. Do not use this + /// variant. + #[doc(hidden)] __Nonexhaustive, } impl Default for DataFormat { @@ -1182,6 +1186,7 @@ impl From<DataFormat> for char { Unicode => 'u', MIME => 'm', Unknown(c) => c, + __Nonexhaustive => unreachable!(), } } } @@ -1201,6 +1206,7 @@ impl fmt::Display for DataFormat { Unknown(c) => f.write_fmt(format_args!( "Unknown data format identifier {:?}", c)), + __Nonexhaustive => unreachable!(), } } } |