Skip to content

Commit

Permalink
Replace atty with std::io::IsTerminal
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto committed Jun 29, 2023
1 parent 9940513 commit 09c6105
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ tempfile = "3.3.0"
indoc = "1.0.8"
log = "0.4.17"
env_logger = "0.10.0"
atty = "0.2.14"
encoding_rs_io = "0.1.7"
reqwest = { version = "0.11.13", features = ["blocking", "json", "rustls-tls", "rustls-tls-native-roots", "brotli"], default-features = false }
url = "2.3.1"
Expand Down
4 changes: 2 additions & 2 deletions src/commands/use.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ fn replace_symlink(from: &std::path::Path, to: &std::path::Path) -> std::io::Res
}

fn should_install_interactively(requested_version: &UserVersion) -> bool {
use std::io::Write;
use std::io::{IsTerminal, Write};

if !(atty::is(atty::Stream::Stdout) && atty::is(atty::Stream::Stdin)) {
if !(std::io::stdout().is_terminal() && std::io::stdin().is_terminal()) {
return false;
}

Expand Down

0 comments on commit 09c6105

Please sign in to comment.