mirror of
https://github.com/MedzikUser/HomeDisk.git
synced 2024-08-14 21:46:53 +00:00
16 lines
400 B
Rust
16 lines
400 B
Rust
use std::fmt;
|
|
|
|
#[derive(Debug, Clone, Eq, PartialEq)]
|
|
pub enum Error {
|
|
UnknownAlgorithm(&'static str, String),
|
|
}
|
|
|
|
pub type Result<T> = std::result::Result<T, Error>;
|
|
|
|
impl fmt::Display for Error {
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
match self {
|
|
Error::UnknownAlgorithm(typ, named) => write!(f, "unknown {} algorithm {}", typ, named),
|
|
}
|
|
}
|
|
}
|