22 lines
444 B
Rust
22 lines
444 B
Rust
use std::fmt::{Display, Formatter, Result};
|
|
|
|
#[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.
|
|
Mime,
|
|
}
|
|
|
|
impl Display for ScanError {
|
|
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
|
write!(
|
|
f,
|
|
"{}",
|
|
match self {
|
|
Self::File => "Couldn't read file",
|
|
Self::Mime => "Couldn't determine mime type",
|
|
}
|
|
)
|
|
}
|
|
}
|