# HG changeset patch # User Raphaël Gomès # Date 1730730512 -3600 # Node ID 56e8841a454ce38946476561c170866d8999f9bf # Parent 492d167aa5084861945b0c44e50d4e955ce87505 rust: remove `atty` dependency It is fully replaced with the now stable `std::io::IsTerminal` trait. This was the last dependency flagged as a warning by `cargo audit`, aside from `cpython` which we know about all too well: the plan is to transition to PyO3 soon-ish. diff -r 492d167aa508 -r 56e8841a454c rust/Cargo.lock --- a/rust/Cargo.lock Mon Nov 04 15:33:17 2024 +0100 +++ b/rust/Cargo.lock Mon Nov 04 15:28:32 2024 +0100 @@ -1189,7 +1189,6 @@ name = "rhg" version = "0.1.0" dependencies = [ - "atty", "chrono", "clap", "derive_more", diff -r 492d167aa508 -r 56e8841a454c rust/rhg/Cargo.toml --- a/rust/rhg/Cargo.toml Mon Nov 04 15:33:17 2024 +0100 +++ b/rust/rhg/Cargo.toml Mon Nov 04 15:28:32 2024 +0100 @@ -8,7 +8,6 @@ edition = "2021" [dependencies] -atty = "0.2.14" hg-core = { path = "../hg-core"} chrono = "0.4.23" clap = { version = "4", features = ["cargo"] } diff -r 492d167aa508 -r 56e8841a454c rust/rhg/src/ui.rs --- a/rust/rhg/src/ui.rs Mon Nov 04 15:33:17 2024 +0100 +++ b/rust/rhg/src/ui.rs Mon Nov 04 15:28:32 2024 +0100 @@ -12,6 +12,7 @@ use hg::utils::files::get_bytes_from_path; use std::borrow::Cow; use std::io; +use std::io::IsTerminal; use std::io::{ErrorKind, Write}; pub struct Ui { @@ -237,7 +238,7 @@ Ok(if config.get_bool(b"ui", b"nontty")? { false } else { - atty::is(atty::Stream::Stdout) + std::io::stdout().is_terminal() }) }