[go: up one dir, main page]

colored 2.1.0

The most simple way to add colors in your terminal
Documentation
use super::ColoredString;
use std::{error::Error, fmt};

pub struct ColoredStringError(pub ColoredString);

impl ColoredStringError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "{}", self.0.to_string())
    }
}

impl fmt::Display for ColoredStringError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        self.fmt(f)
    }
}

impl fmt::Debug for ColoredStringError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        self.fmt(f)
    }
}

impl Error for ColoredStringError {}