Skip to content

Commit

Permalink
Merge pull request #81 from ChrisCA/main
Browse files Browse the repository at this point in the history
replace dependency to atty for windows targets by std implementation
  • Loading branch information
borntyping authored Jun 12, 2023
2 parents 3a78bcf + ccb0d8f commit 68db75e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down

0 comments on commit 68db75e

Please sign in to comment.