diff --git a/Cargo.lock b/Cargo.lock index e2a09e2ee5..634ee98ecb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -613,17 +613,6 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "auth-git2" version = "0.5.4" @@ -2443,7 +2432,6 @@ dependencies = [ "ansi-to-html", "ansi-to-tui", "anyhow", - "atty", "axum 0.7.5", "axum-extra", "axum-server", @@ -4934,15 +4922,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.3.9" diff --git a/packages/cli/Cargo.toml b/packages/cli/Cargo.toml index 9a992e5aab..007905a102 100644 --- a/packages/cli/Cargo.toml +++ b/packages/cli/Cargo.toml @@ -32,7 +32,6 @@ html_parser = { workspace = true } cargo_metadata = "0.18.1" tokio = { version = "1.16.1", features = ["fs", "sync", "rt", "macros", "process", "rt-multi-thread"] } tokio-stream = "0.1.15" -atty = "0.2.14" chrono = "0.4.19" anyhow = "1" hyper = { workspace = true } diff --git a/packages/cli/src/cli/translate.rs b/packages/cli/src/cli/translate.rs index 9676f18a53..fdaf37cf83 100644 --- a/packages/cli/src/cli/translate.rs +++ b/packages/cli/src/cli/translate.rs @@ -1,4 +1,4 @@ -use std::process::exit; +use std::{io::IsTerminal as _, process::exit}; use dioxus_rsx::{BodyNode, CallBody, TemplateBody}; @@ -121,7 +121,7 @@ fn determine_input(file: Option, raw: Option) -> Result } // If neither exist, we try to read from stdin - if atty::is(atty::Stream::Stdin) { + if std::io::stdin().is_terminal() { return custom_error!("No input file, source, or stdin to translate from."); }