2021-02-14 17:12:27 +00:00
|
|
|
use std::fmt::{Display, Formatter, Result};
|
|
|
|
|
2021-02-21 14:07:50 +00:00
|
|
|
#[derive(Debug)]
|
2021-02-10 09:20:22 +00:00
|
|
|
pub enum ScanError {
|
|
|
|
File,
|
2021-02-18 09:48:38 +00:00
|
|
|
Mime,
|
2021-02-14 17:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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-14 17:12:27 +00:00
|
|
|
)
|
|
|
|
}
|
2021-02-18 09:48:38 +00:00
|
|
|
}
|