Skip to content

Commit 2a41112

Browse files
committed
use non_exhaustive attribute (MSRV: 1.40)
1 parent 44eb42e commit 2a41112

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/format/mod.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ impl ParseError {
357357

358358
/// The category of parse error
359359
#[derive(Debug, Clone, PartialEq, Eq, Copy, Hash)]
360+
#[non_exhaustive]
360361
pub enum ParseErrorKind {
361362
/// Given field is out of permitted range.
362363
OutOfRange,
@@ -385,10 +386,6 @@ pub enum ParseErrorKind {
385386

386387
/// There was an error on the formatting string, or there were non-supported formating items.
387388
BadFormat,
388-
389-
// TODO: Change this to `#[non_exhaustive]` (on the enum) when MSRV is increased
390-
#[doc(hidden)]
391-
__Nonexhaustive,
392389
}
393390

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

0 commit comments

Comments
 (0)