diff --git a/Cargo.toml b/Cargo.toml index a1cde3f8..e0e9b920 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ resolver = "2" [workspace.package] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.64.0" # MSRV +rust-version = "1.70.0" # MSRV include = [ "build.rs", "src/**/*", diff --git a/crates/anstyle-wincon/src/console.rs b/crates/anstyle-wincon/src/console.rs index 33584283..f89de843 100644 --- a/crates/anstyle-wincon/src/console.rs +++ b/crates/anstyle-wincon/src/console.rs @@ -87,11 +87,24 @@ where Ok(()) } + fn as_stream(&self) -> &S { + self.stream.as_ref().unwrap() + } + fn as_stream_mut(&mut self) -> &mut S { self.stream.as_mut().unwrap() } } +impl Console +where + S: crate::WinconStream + std::io::Write + std::io::IsTerminal, +{ + pub fn is_terminal(&self) -> bool { + std::io::IsTerminal::is_terminal(self.as_stream()) + } +} + impl Drop for Console where S: crate::WinconStream + std::io::Write,