summaryrefslogtreecommitdiffstats
path: root/vendor/anstyle/src/reset.rs
blob: c8c214093f4c8e574ea1836f41ad3eda90b05a83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/// Reset terminal formatting
#[derive(Copy, Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Reset;

impl Reset {
    /// Render the ANSI code
    #[inline]
    pub fn render(self) -> impl core::fmt::Display + Copy + Clone {
        ResetDisplay
    }
}

#[derive(Copy, Clone, Default, Debug)]
struct ResetDisplay;

impl core::fmt::Display for ResetDisplay {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        RESET.fmt(f)
    }
}

pub(crate) const RESET: &str = "\x1B[0m";