1/// Reset terminal formatting
2#[derive(Copy, Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
3pub struct Reset;
4
5impl Reset {
6 /// Render the ANSI code
7 #[inline]
8 pub fn render(self) -> impl core::fmt::Display + Copy + Clone {
9 ResetDisplay
10 }
11}
12
13#[derive(Copy, Clone, Default, Debug)]
14struct ResetDisplay;
15
16impl core::fmt::Display for ResetDisplay {
17 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
18 RESET.fmt(f)
19 }
20}
21
22pub(crate) const RESET: &str = "\x1B[0m";
23