Skip to content

Commit

Permalink
use non_exhaustive attribute (MSRV: 1.40)
Browse files Browse the repository at this point in the history
  • Loading branch information
pitdicker committed Apr 18, 2023
1 parent 44eb42e commit 2a41112
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/format/mod.rs
Expand Up @@ -357,6 +357,7 @@ impl ParseError {

/// The category of parse error
#[derive(Debug, Clone, PartialEq, Eq, Copy, Hash)]
#[non_exhaustive]
pub enum ParseErrorKind {
/// Given field is out of permitted range.
OutOfRange,
Expand Down Expand Up @@ -385,10 +386,6 @@ pub enum ParseErrorKind {

/// There was an error on the formatting string, or there were non-supported formating items.
BadFormat,

// TODO: Change this to `#[non_exhaustive]` (on the enum) when MSRV is increased
#[doc(hidden)]
__Nonexhaustive,
}

/// Same as `Result<T, ParseError>`.
Expand All @@ -404,7 +401,6 @@ impl fmt::Display for ParseError {
ParseErrorKind::TooShort => write!(f, "premature end of input"),
ParseErrorKind::TooLong => write!(f, "trailing input"),
ParseErrorKind::BadFormat => write!(f, "bad or unsupported format string"),
_ => unreachable!(),
}
}
}
Expand Down

0 comments on commit 2a41112

Please sign in to comment.