fif/src/scanerror.rs

21 lines
324 B
Rust
Raw Normal View History

use std::fmt::{Display, Formatter, Result};
2021-02-21 14:07:50 +00:00
#[derive(Debug)]
pub enum ScanError {
File,
2021-02-18 09:48:38 +00:00
Mime,
}
impl Display for ScanError {
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
2021-02-18 09:48:38 +00:00
write!(
f,
"{}",
match self {
Self::File => "Couldn't read file",
Self::Mime => "Couldn't determine mime type",
}
)
}
2021-02-18 09:48:38 +00:00
}