diff --git a/src/game/card/property/moves.rs b/src/game/card/property/moves.rs index c5969eb..76e5a1d 100644 --- a/src/game/card/property/moves.rs +++ b/src/game/card/property/moves.rs @@ -111,19 +111,17 @@ impl Validatable for Move { } /// All warnings for [`Move`] validation -#[derive(PartialEq, Eq, Clone, Debug)] -#[derive(derive_more::Display)] +#[derive(PartialEq, Eq, Clone, Debug, thiserror::Error)] pub enum ValidationWarning { /// Power is not a multiple of 10 - #[display(fmt = "Power is not a multiple of 10.")] + #[error("Power is not a multiple of 10.")] PowerMultiple10, } /// All errors for [`Move`] validation -#[derive(PartialEq, Eq, Clone, Debug)] -#[derive(derive_more::Display)] +#[derive(PartialEq, Eq, Clone, Debug, thiserror::Error)] pub enum ValidationError { /// Name length - #[display(fmt = "Name is too long. Must be at most 21 characters")] + #[error("Name is too long. Must be at most 21 characters")] NameTooLong, } diff --git a/src/io/address/data.rs b/src/io/address/data.rs index a2f2ef9..8a54631 100644 --- a/src/io/address/data.rs +++ b/src/io/address/data.rs @@ -14,6 +14,7 @@ use crate::{ /// All addresses of type `Data` will represent the position /// within *only* the data sections on the file. #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] +#[derive(derive_more::From, derive_more::Into)] pub struct Data(u64); impl Data { @@ -68,18 +69,6 @@ impl Data { } } -// Conversions from and into u64 -impl From for u64 { - fn from(address: Data) -> Self { - address.0 - } -} -impl From for Data { - fn from(address: u64) -> Self { - Self(address) - } -} - // Data + Offset impl std::ops::Add for Data { type Output = Self;