mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-23 15:51:03 +00:00
18 lines
391 B
Rust
18 lines
391 B
Rust
use std::{error::Error, fmt::{self, Display}};
|
|
|
|
#[derive(Debug)]
|
|
pub enum InputError {
|
|
Typed(String),
|
|
Canceled(String),
|
|
}
|
|
|
|
impl Display for InputError {
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
match self {
|
|
Self::Typed(text) => write!(f, "Typed error: {text}"),
|
|
Self::Canceled(text) => write!(f, "Canceled error: {text}"),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl Error for InputError {}
|