mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-07-11 21:34:42 +10:00
6630ccd5e0
Signed-off-by: quexeky <git@quexeky.dev>
21 lines
585 B
Rust
21 lines
585 B
Rust
use std::fmt::Display;
|
|
|
|
use serde_with::SerializeDisplay;
|
|
|
|
#[derive(Debug, SerializeDisplay, Clone, Copy)]
|
|
pub enum BackupError {
|
|
InvalidSystem,
|
|
NotFound,
|
|
ParseError
|
|
}
|
|
|
|
impl Display for BackupError {
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
let s = match self {
|
|
BackupError::InvalidSystem => "Attempted to generate path for invalid system",
|
|
BackupError::NotFound => "Could not generate or find path",
|
|
BackupError::ParseError => "Failed to parse path",
|
|
};
|
|
write!(f, "{}", s)
|
|
}
|
|
} |