tmux-copyrat/src/error.rs

19 lines
494 B
Rust
Raw Normal View History

2020-05-24 21:02:11 +02:00
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, ...)"),
}
}
}