From 1c6e9aeb76097bcfeb35607f2b4e8b904d440bce Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 16 Jan 2024 15:33:37 -0600 Subject: [PATCH] fix(anstream): Loosen WinconStream's bounds --- crates/anstream/src/wincon.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/crates/anstream/src/wincon.rs b/crates/anstream/src/wincon.rs index a5aa5e74..a5e29d9c 100644 --- a/crates/anstream/src/wincon.rs +++ b/crates/anstream/src/wincon.rs @@ -1,13 +1,13 @@ use crate::adapter::WinconBytes; use crate::stream::AsLockedWrite; -use crate::stream::RawStream; +use crate::stream::IsTerminal; /// Only pass printable data to the inner `Write` #[cfg(feature = "wincon")] // here mostly for documentation purposes #[derive(Debug)] pub struct WinconStream where - S: RawStream, + S: anstyle_wincon::WinconStream, { raw: S, // `WinconBytes` is especially large compared to other variants of `AutoStream`, so boxing it @@ -18,7 +18,7 @@ where impl WinconStream where - S: RawStream, + S: anstyle_wincon::WinconStream, { /// Only pass printable data to the inner `Write` #[inline] @@ -29,12 +29,18 @@ where } } - /// Get the wrapped [`RawStream`] + /// Get the wrapped [`anstyle_wincon::WinconStream`] #[inline] pub fn into_inner(self) -> S { self.raw } +} +impl StripStream +where + S: anstyle_wincon::WinconStream, + S: IsTerminal, +{ #[inline] pub fn is_terminal(&self) -> bool { self.raw.is_terminal()