diff options
Diffstat (limited to 'openpgp/src/message')
-rw-r--r-- | openpgp/src/message/lexer.rs | 5 | ||||
-rw-r--r-- | openpgp/src/message/mod.rs | 6 |
2 files changed, 2 insertions, 9 deletions
diff --git a/openpgp/src/message/lexer.rs b/openpgp/src/message/lexer.rs index b0a0c16b..623dc05d 100644 --- a/openpgp/src/message/lexer.rs +++ b/openpgp/src/message/lexer.rs @@ -11,6 +11,7 @@ pub(crate) type LexerItem<Tok, Loc, Error> /// /// Note: This enum cannot be exhaustively matched to allow future /// extensions. +#[non_exhaustive] #[derive(Debug, Clone, Copy, PartialEq)] pub enum Token { /// A Literal data packet. @@ -40,10 +41,6 @@ pub enum Token { /// A container's unparsed content. OpaqueContent, - - /// This marks this enum as non-exhaustive. Do not use this - /// variant. - #[doc(hidden)] __Nonexhaustive, } impl fmt::Display for Token { diff --git a/openpgp/src/message/mod.rs b/openpgp/src/message/mod.rs index 82dd1695..5b35f161 100644 --- a/openpgp/src/message/mod.rs +++ b/openpgp/src/message/mod.rs @@ -48,16 +48,13 @@ use self::grammar::MessageParser; /// /// Note: This enum cannot be exhaustively matched to allow future /// extensions. +#[non_exhaustive] #[derive(Debug, Clone)] pub enum MessageParserError { /// A parser error. Parser(ParseError<usize, Token, LexicalError>), /// An OpenPGP error. OpenPGP(Error), - - /// This marks this enum as non-exhaustive. Do not use this - /// variant. - #[doc(hidden)] __Nonexhaustive, } impl From<MessageParserError> for anyhow::Error { @@ -65,7 +62,6 @@ impl From<MessageParserError> for anyhow::Error { match err { MessageParserError::Parser(p) => p.into(), MessageParserError::OpenPGP(p) => p.into(), - MessageParserError::__Nonexhaustive => unreachable!(), } } } |