Kaynağa Gözat

Merge pull request #81 from ChrisCA/main

replace dependency to atty for windows targets by std implementation
Sam Clements 1 yıl önce
ebeveyn
işleme
68db75e88c
2 değiştirilmiş dosya ile 2 ekleme ve 3 silme
  1. 0 1
      Cargo.toml
  2. 2 2
      src/lib.rs

+ 0 - 1
Cargo.toml

@@ -21,7 +21,6 @@ time = { version = "^0.3.16", features = ["formatting", "local-offset", "macros"
 colored = { version = "2", optional = true }
 
 [target.'cfg(windows)'.dependencies]
-atty = "^0.2.14"
 windows-sys = { version = "^0.42.0", features = ["Win32_System_Console", "Win32_Foundation"] }
 
 [[example]]

+ 2 - 2
src/lib.rs

@@ -490,9 +490,9 @@ impl Log for SimpleLogger {
 
 #[cfg(all(windows, feature = "colored"))]
 fn set_up_color_terminal() {
-    use atty::Stream;
+    use std::io::{stdout, IsTerminal};
 
-    if atty::is(Stream::Stdout) {
+    if stdout().is_terminal() {
         unsafe {
             use windows_sys::Win32::Foundation::INVALID_HANDLE_VALUE;
             use windows_sys::Win32::System::Console::{