refactor!(argus-core): remove unnecessary traits and Copy constraints

This commit is contained in:
Anand Balakrishnan 2023-08-29 18:16:10 -07:00
parent 86cef692dc
commit 28a79cb88c
No known key found for this signature in database
9 changed files with 255 additions and 271 deletions

View file

@ -87,6 +87,16 @@ pub enum Error {
},
}
impl Error {
/// An [`InvalidCast`](Error::InvalidCast) error from `T` to `U`.
pub fn invalid_cast<T, U>() -> Self {
Self::InvalidCast {
from: std::any::type_name::<T>(),
to: std::any::type_name::<U>(),
}
}
}
/// Alias for [`Error`](enum@Error)
pub type ArgusError = Error;
/// Alias for [`Result<T, ArgusError>`]