fif/src/scanerror.rs

23 lines
444 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 {
/// Something went wrong while trying to read the given file.
File,
/// Failed to determine the mimetype of the given 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
}