diff --git a/example/puzzles/Cargo.toml b/example/puzzles/Cargo.toml index caa54c9..2fa3c79 100644 --- a/example/puzzles/Cargo.toml +++ b/example/puzzles/Cargo.toml @@ -1,8 +1,7 @@ [package] name = "puzzles" version = "0.1.0" -authors = ["Nathan Stocks "] -edition = "2018" +edition = "2021" [dependencies] thiserror = "1.0" diff --git a/example/puzzles/src/lib.rs b/example/puzzles/src/lib.rs index 7e95733..5ffddf0 100644 --- a/example/puzzles/src/lib.rs +++ b/example/puzzles/src/lib.rs @@ -147,7 +147,7 @@ pub enum PuzzleType { // } // } -// #[derive(Debug)] // #5: Debug + Display + Exception +// #[derive(Debug)] // #5: Debug + Display + Error // #[non_exhaustive] // #4: Non-Exhaustive // pub enum PuzzleError { // // #1: enum @@ -155,6 +155,7 @@ pub enum PuzzleType { // MissingPiece, // #3: Only YOUR Errors // } +// #5: Debug + Display + Error #[derive(Debug, Error)] #[non_exhaustive] pub enum PuzzleError { @@ -164,8 +165,8 @@ pub enum PuzzleError { MissingPiece, } +// #5: Debug + Display + Error // impl Display for PuzzleError { -// // #5: Debug + Display + Exception // fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { // use PuzzleError::*; // match self { @@ -175,9 +176,5 @@ pub enum PuzzleError { // } // } -// impl Error for PuzzleError { -// // #5: Debug + Display + Exception -// fn source(&self) -> Option<&(dyn Error + 'static)> { -// None -// } -// } +// #5: Debug + Display + Error +// impl Error for PuzzleError {}