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