Implemented thiserror.
This commit is contained in:
@@ -28,13 +28,6 @@ impl TryFrom<String> for Direction {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
#[error("invalid direction value: {0}")]
|
||||
pub struct DirectionConversionError(pub String);
|
||||
|
||||
impl std::error::Error for DirectionConversionError {}
|
||||
|
||||
impl std::fmt::Display for DirectionConversionError {
|
||||
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(formatter, "invalid direction value: {}", self.0)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user