diff options
author | Valentin Popov <valentin@popov.link> | 2024-07-19 15:37:58 +0300 |
---|---|---|
committer | Valentin Popov <valentin@popov.link> | 2024-07-19 15:37:58 +0300 |
commit | a990de90fe41456a23e58bd087d2f107d321f3a1 (patch) | |
tree | 15afc392522a9e85dc3332235e311b7d39352ea9 /vendor/anstream/src/buffer.rs | |
parent | 3d48cd3f81164bbfc1a755dc1d4a9a02f98c8ddd (diff) | |
download | fparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.tar.xz fparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.zip |
Deleted vendor folder
Diffstat (limited to 'vendor/anstream/src/buffer.rs')
-rw-r--r-- | vendor/anstream/src/buffer.rs | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/vendor/anstream/src/buffer.rs b/vendor/anstream/src/buffer.rs deleted file mode 100644 index 9846bb7..0000000 --- a/vendor/anstream/src/buffer.rs +++ /dev/null @@ -1,68 +0,0 @@ -#![allow(deprecated)] - -/// In-memory [`RawStream`][crate::stream::RawStream] -#[derive(Clone, Default, Debug, PartialEq, Eq)] -#[deprecated(since = "0.6.2", note = "Use Vec")] -#[doc(hidden)] -pub struct Buffer(Vec<u8>); - -impl Buffer { - #[inline] - pub fn new() -> Self { - Default::default() - } - - #[inline] - pub fn with_capacity(capacity: usize) -> Self { - Self(Vec::with_capacity(capacity)) - } - - #[inline] - pub fn as_bytes(&self) -> &[u8] { - &self.0 - } -} - -impl AsRef<[u8]> for Buffer { - #[inline] - fn as_ref(&self) -> &[u8] { - self.as_bytes() - } -} - -impl std::io::Write for Buffer { - #[inline] - fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> { - self.0.extend(buf); - Ok(buf.len()) - } - - #[inline] - fn flush(&mut self) -> std::io::Result<()> { - Ok(()) - } -} - -#[cfg(all(windows, feature = "wincon"))] -impl anstyle_wincon::WinconStream for Buffer { - fn write_colored( - &mut self, - fg: Option<anstyle::AnsiColor>, - bg: Option<anstyle::AnsiColor>, - data: &[u8], - ) -> std::io::Result<usize> { - self.0.write_colored(fg, bg, data) - } -} - -#[cfg(all(windows, feature = "wincon"))] -impl anstyle_wincon::WinconStream for &'_ mut Buffer { - fn write_colored( - &mut self, - fg: Option<anstyle::AnsiColor>, - bg: Option<anstyle::AnsiColor>, - data: &[u8], - ) -> std::io::Result<usize> { - (**self).write_colored(fg, bg, data) - } -} |