Mercurial > public > mercurial-scm > hg
diff rust/rhg/src/ui.rs @ 52309:56e8841a454c
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.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Mon, 04 Nov 2024 15:28:32 +0100 |
parents | 22d24f6d6411 |
children | 65839176cea9 |
line wrap: on
line diff
--- 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() }) }