From d7f7e7a559084d91d6ccca7ba444759b5b28d2a9 Mon Sep 17 00:00:00 2001 From: AurelienFT Date: Tue, 22 Oct 2024 11:58:34 +0200 Subject: [PATCH] Remove unmaintained atty. --- Cargo.lock | 1 - bin/keygen/Cargo.toml | 1 - bin/keygen/src/main.rs | 8 ++------ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7574ea76ac7..e9970a5384c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3505,7 +3505,6 @@ name = "fuel-core-keygen-bin" version = "0.40.0" dependencies = [ "anyhow", - "atty", "clap 4.5.20", "crossterm", "fuel-core-keygen", diff --git a/bin/keygen/Cargo.toml b/bin/keygen/Cargo.toml index 4df8783a65b..58e24b3ff12 100644 --- a/bin/keygen/Cargo.toml +++ b/bin/keygen/Cargo.toml @@ -15,7 +15,6 @@ path = "src/main.rs" [dependencies] anyhow = { workspace = true } -atty = "0.2.14" clap = { workspace = true, features = ["derive", "env"] } crossterm = "0.27.0" fuel-core-keygen = { workspace = true } diff --git a/bin/keygen/src/main.rs b/bin/keygen/src/main.rs index 02a6695454a..bc391d434e4 100644 --- a/bin/keygen/src/main.rs +++ b/bin/keygen/src/main.rs @@ -1,5 +1,4 @@ //! A simple keygen cli utility tool for configuring fuel-core -use atty::Stream; use clap::Parser; use crossterm::terminal; use fuel_core_keygen::{ @@ -8,10 +7,7 @@ use fuel_core_keygen::{ KeyType, }; use std::io::{ - stdin, - stdout, - Read, - Write, + stdin, stdout, IsTerminal, Read, Write }; use termion::screen::IntoAlternateScreen; @@ -88,7 +84,7 @@ fn display_string_discreetly( discreet_string: &str, continue_message: &str, ) -> anyhow::Result<()> { - if atty::is(Stream::Stdout) { + if stdout().is_terminal() { let mut screen = stdout().into_alternate_screen()?; writeln!(screen, "{discreet_string}")?; screen.flush()?;