fix some issues with the puzzles example
This commit is contained in:
@@ -1,8 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "puzzles"
|
name = "puzzles"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Nathan Stocks <nathan@agileperception.com>"]
|
edition = "2021"
|
||||||
edition = "2018"
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ pub enum PuzzleType {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// #[derive(Debug)] // #5: Debug + Display + Exception
|
// #[derive(Debug)] // #5: Debug + Display + Error
|
||||||
// #[non_exhaustive] // #4: Non-Exhaustive
|
// #[non_exhaustive] // #4: Non-Exhaustive
|
||||||
// pub enum PuzzleError {
|
// pub enum PuzzleError {
|
||||||
// // #1: enum
|
// // #1: enum
|
||||||
@@ -155,6 +155,7 @@ pub enum PuzzleType {
|
|||||||
// MissingPiece, // #3: Only YOUR Errors
|
// MissingPiece, // #3: Only YOUR Errors
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
// #5: Debug + Display + Error
|
||||||
#[derive(Debug, Error)]
|
#[derive(Debug, Error)]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
pub enum PuzzleError {
|
pub enum PuzzleError {
|
||||||
@@ -164,8 +165,8 @@ pub enum PuzzleError {
|
|||||||
MissingPiece,
|
MissingPiece,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// #5: Debug + Display + Error
|
||||||
// impl Display for PuzzleError {
|
// impl Display for PuzzleError {
|
||||||
// // #5: Debug + Display + Exception
|
|
||||||
// fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
|
// fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
|
||||||
// use PuzzleError::*;
|
// use PuzzleError::*;
|
||||||
// match self {
|
// match self {
|
||||||
@@ -175,9 +176,5 @@ pub enum PuzzleError {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// impl Error for PuzzleError {
|
// #5: Debug + Display + Error
|
||||||
// // #5: Debug + Display + Exception
|
// impl Error for PuzzleError {}
|
||||||
// fn source(&self) -> Option<&(dyn Error + 'static)> {
|
|
||||||
// None
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|||||||
Reference in New Issue
Block a user