diff --git a/crates/anstream/src/auto.rs b/crates/anstream/src/auto.rs index b252c05c..a4f71f30 100644 --- a/crates/anstream/src/auto.rs +++ b/crates/anstream/src/auto.rs @@ -130,7 +130,7 @@ where StreamInner::PassThrough(w) => w.is_terminal(), StreamInner::Strip(w) => w.is_terminal(), #[cfg(all(windows, feature = "wincon"))] - StreamInner::Wincon(w) => true, + StreamInner::Wincon(_) => true, // its only ever a terminal } } } diff --git a/crates/anstyle-wincon/src/console.rs b/crates/anstyle-wincon/src/console.rs index 6b89740c..eb7f590e 100644 --- a/crates/anstyle-wincon/src/console.rs +++ b/crates/anstyle-wincon/src/console.rs @@ -106,6 +106,18 @@ where } } +impl Drop for Console +where + S: crate::WinconStream + std::io::Write, +{ + fn drop(&mut self) { + // Otherwise `Console::lock` took it + if self.stream.is_some() { + let _ = self.reset(); + } + } +} + impl Console where S: crate::WinconStream + std::io::Write, @@ -142,15 +154,3 @@ where self.lock() } } - -impl Drop for Console -where - S: crate::WinconStream + std::io::Write, -{ - fn drop(&mut self) { - // Otherwise `Console::lock` took it - if self.stream.is_some() { - let _ = self.reset(); - } - } -}