diff options
Diffstat (limited to 'src/libs/intertrait/cast/error.rs')
-rw-r--r-- | src/libs/intertrait/cast/error.rs | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/libs/intertrait/cast/error.rs b/src/libs/intertrait/cast/error.rs index e4211b1..74eb3ca 100644 --- a/src/libs/intertrait/cast/error.rs +++ b/src/libs/intertrait/cast/error.rs @@ -1,17 +1,10 @@ -use std::fmt; -use std::fmt::{Display, Formatter}; - -use error_stack::Context; - -#[derive(Debug)] -pub struct CastError; - -impl Display for CastError +#[derive(thiserror::Error, Debug)] +pub enum CastError { - fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result + #[error("Failed to cast from trait {from} to trait {to}")] + CastFailed { - fmt.write_str("Failed to cast between traits") - } + from: &'static str, + to: &'static str, + }, } - -impl Context for CastError {} |