colored/
error.rs

1use super::ColoredString;
2use std::{error::Error, fmt};
3
4pub struct ColoredStringError(pub ColoredString);
5
6impl ColoredStringError {
7    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
8        write!(f, "{}", self.0)
9    }
10}
11
12impl fmt::Display for ColoredStringError {
13    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
14        self.fmt(f)
15    }
16}
17
18impl fmt::Debug for ColoredStringError {
19    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
20        self.fmt(f)
21    }
22}
23
24impl Error for ColoredStringError {}