diff options
author | Valentin Popov <valentin@popov.link> | 2024-01-08 00:21:28 +0300 |
---|---|---|
committer | Valentin Popov <valentin@popov.link> | 2024-01-08 00:21:28 +0300 |
commit | 1b6a04ca5504955c571d1c97504fb45ea0befee4 (patch) | |
tree | 7579f518b23313e8a9748a88ab6173d5e030b227 /vendor/anstyle/src/reset.rs | |
parent | 5ecd8cf2cba827454317368b68571df0d13d7842 (diff) | |
download | fparkan-1b6a04ca5504955c571d1c97504fb45ea0befee4.tar.xz fparkan-1b6a04ca5504955c571d1c97504fb45ea0befee4.zip |
Initial vendor packages
Signed-off-by: Valentin Popov <valentin@popov.link>
Diffstat (limited to 'vendor/anstyle/src/reset.rs')
-rw-r--r-- | vendor/anstyle/src/reset.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/vendor/anstyle/src/reset.rs b/vendor/anstyle/src/reset.rs new file mode 100644 index 0000000..c8c2140 --- /dev/null +++ b/vendor/anstyle/src/reset.rs @@ -0,0 +1,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"; |