From a990de90fe41456a23e58bd087d2f107d321f3a1 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Fri, 19 Jul 2024 16:37:58 +0400 Subject: Deleted vendor folder --- vendor/anstyle-wincon/src/stream.rs | 178 ------------------------------------ 1 file changed, 178 deletions(-) delete mode 100644 vendor/anstyle-wincon/src/stream.rs (limited to 'vendor/anstyle-wincon/src/stream.rs') diff --git a/vendor/anstyle-wincon/src/stream.rs b/vendor/anstyle-wincon/src/stream.rs deleted file mode 100644 index 9f10108..0000000 --- a/vendor/anstyle-wincon/src/stream.rs +++ /dev/null @@ -1,178 +0,0 @@ -/// Extend `std::io::Write` with wincon styling -pub trait WinconStream { - /// Write colored text to the stream - fn write_colored( - &mut self, - fg: Option, - bg: Option, - data: &[u8], - ) -> std::io::Result; -} - -impl WinconStream for Box { - fn write_colored( - &mut self, - fg: Option, - bg: Option, - data: &[u8], - ) -> std::io::Result { - crate::ansi::write_colored(self, fg, bg, data) - } -} - -impl WinconStream for &'_ mut Box { - fn write_colored( - &mut self, - fg: Option, - bg: Option, - data: &[u8], - ) -> std::io::Result { - (**self).write_colored(fg, bg, data) - } -} - -impl WinconStream for std::fs::File { - fn write_colored( - &mut self, - fg: Option, - bg: Option, - data: &[u8], - ) -> std::io::Result { - crate::ansi::write_colored(self, fg, bg, data) - } -} - -impl WinconStream for &'_ mut std::fs::File { - fn write_colored( - &mut self, - fg: Option, - bg: Option, - data: &[u8], - ) -> std::io::Result { - (**self).write_colored(fg, bg, data) - } -} - -impl WinconStream for Vec { - fn write_colored( - &mut self, - fg: Option, - bg: Option, - data: &[u8], - ) -> std::io::Result { - crate::ansi::write_colored(self, fg, bg, data) - } -} - -impl WinconStream for &'_ mut Vec { - fn write_colored( - &mut self, - fg: Option, - bg: Option, - data: &[u8], - ) -> std::io::Result { - (**self).write_colored(fg, bg, data) - } -} - -impl WinconStream for std::io::Stdout { - fn write_colored( - &mut self, - fg: Option, - bg: Option, - data: &[u8], - ) -> std::io::Result { - // Ensure exclusive access - self.lock().write_colored(fg, bg, data) - } -} - -impl WinconStream for std::io::Stderr { - fn write_colored( - &mut self, - fg: Option, - bg: Option, - data: &[u8], - ) -> std::io::Result { - // Ensure exclusive access - self.lock().write_colored(fg, bg, data) - } -} - -#[cfg(not(windows))] -mod platform { - use super::*; - - impl WinconStream for std::io::StdoutLock<'_> { - fn write_colored( - &mut self, - fg: Option, - bg: Option, - data: &[u8], - ) -> std::io::Result { - crate::ansi::write_colored(self, fg, bg, data) - } - } - - impl WinconStream for std::io::StderrLock<'_> { - fn write_colored( - &mut self, - fg: Option, - bg: Option, - data: &[u8], - ) -> std::io::Result { - crate::ansi::write_colored(self, fg, bg, data) - } - } -} - -#[cfg(windows)] -mod platform { - use super::*; - - impl WinconStream for std::io::StdoutLock<'_> { - fn write_colored( - &mut self, - fg: Option, - bg: Option, - data: &[u8], - ) -> std::io::Result { - let initial = crate::windows::stdout_initial_colors(); - crate::windows::write_colored(self, fg, bg, data, initial) - } - } - - impl WinconStream for std::io::StderrLock<'_> { - fn write_colored( - &mut self, - fg: Option, - bg: Option, - data: &[u8], - ) -> std::io::Result { - let initial = crate::windows::stderr_initial_colors(); - crate::windows::write_colored(self, fg, bg, data, initial) - } - } -} - -impl WinconStream for &'_ mut std::io::StdoutLock<'_> { - fn write_colored( - &mut self, - fg: Option, - bg: Option, - data: &[u8], - ) -> std::io::Result { - (**self).write_colored(fg, bg, data) - } -} - -impl WinconStream for &'_ mut std::io::StderrLock<'_> { - fn write_colored( - &mut self, - fg: Option, - bg: Option, - data: &[u8], - ) -> std::io::Result { - (**self).write_colored(fg, bg, data) - } -} -- cgit v1.2.3