mirror of
https://github.com/TECHNOFAB11/tmux-copyrat.git
synced 2025-12-12 08:00:08 +01:00
19 lines
494 B
Rust
19 lines
494 B
Rust
|
|
use std::fmt;
|
||
|
|
|
||
|
|
#[derive(Debug)]
|
||
|
|
pub enum ParseError {
|
||
|
|
ExpectedSurroundingPair,
|
||
|
|
UnknownAlphabet,
|
||
|
|
UnknownColor,
|
||
|
|
}
|
||
|
|
|
||
|
|
impl fmt::Display for ParseError {
|
||
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||
|
|
match self {
|
||
|
|
ParseError::ExpectedSurroundingPair => write!(f, "Expected 2 chars"),
|
||
|
|
ParseError::UnknownAlphabet => write!(f, "Expected a known alphabet"),
|
||
|
|
ParseError::UnknownColor => write!(f, "Expected ANSI color name (magenta, cyan, black, ...)"),
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|