Skip to content

Commit cc3788d

Browse files
committed
Fix the clippy::manual_non_exhaustive warning
``` warning: this seems like a manual implementation of the non-exhaustive pattern --> src/error.rs:11:1 | 11 | pub enum Error { | ^------------- | | | _help: add the attribute: `#[non_exhaustive] pub enum Error` | | 12 | | ParseError { 13 | | msg: String, 14 | | line: usize, ... | 45 | | __NonExhaustive, 46 | | } | |_^ | = note: `#[warn(clippy::manual_non_exhaustive)]` on by default help: remove this variant --> src/error.rs:45:5 | 45 | __NonExhaustive, | ^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_non_exhaustive warning: 1 warning emitted ``` Signed-off-by: Nathaniel McCallum <[email protected]>
1 parent 522605e commit cc3788d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/error.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use std::fmt;
88

99
/// Enum representing the potential errors that TinyTemplate can encounter.
1010
#[derive(Debug)]
11+
#[non_exhaustive]
1112
pub enum Error {
1213
ParseError {
1314
msg: String,
@@ -40,9 +41,6 @@ pub enum Error {
4041
line: usize,
4142
column: usize,
4243
},
43-
44-
#[doc(hidden)]
45-
__NonExhaustive,
4644
}
4745
impl From<SerdeJsonError> for Error {
4846
fn from(err: SerdeJsonError) -> Error {
@@ -102,7 +100,6 @@ impl fmt::Display for Error {
102100
name, line, column, err
103101
)
104102
}
105-
Error::__NonExhaustive => unreachable!(),
106103
}
107104
}
108105
}
@@ -116,7 +113,6 @@ impl StdError for Error {
116113
Error::StdFormatError { .. } => "StdFormatError",
117114
Error::CalledTemplateError { .. } => "CalledTemplateError",
118115
Error::CalledFormatterError { .. } => "CalledFormatterError",
119-
Error::__NonExhaustive => unreachable!(),
120116
}
121117
}
122118
}

0 commit comments

Comments
 (0)