mark enum as non-exhaustive

This commit is contained in:
auronandace
2026-03-08 14:50:31 +00:00
parent 115a43a075
commit 5c77e5723a
+1 -6
View File
@@ -220,6 +220,7 @@ struct Custom {
/// [`io::Error`]: struct.Error.html
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[allow(deprecated)]
#[non_exhaustive]
pub enum ErrorKind {
/// An entity was not found, often a file.
NotFound,
@@ -285,11 +286,6 @@ pub enum ErrorKind {
/// particular number of bytes but only a smaller number of bytes could be
/// read.
UnexpectedEof,
/// A marker variant that tells the compiler that users of this enum cannot
/// match it exhaustively.
#[doc(hidden)]
__Nonexhaustive,
}
impl ErrorKind {
@@ -313,7 +309,6 @@ impl ErrorKind {
ErrorKind::Interrupted => "operation interrupted",
ErrorKind::Other => "other os error",
ErrorKind::UnexpectedEof => "unexpected end of file",
_ => "unknown error",
}
}
}