Skip to content

Commit

Permalink
use is_terminal() instead of atty crate
Browse files Browse the repository at this point in the history
  • Loading branch information
trou committed Jan 24, 2024
1 parent 9b707b2 commit 68f21ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ base64 = "0.21"
percent-encoding = "2.2.0"
clap = "4.3"
crc = "3"
atty = "0.2"
time = {version = "0.3", features=["local-offset", "formatting"]}
regex = {version = "1.5", default-features=false, features=["std", "perf"]}
memmap2 = "0.5"
Expand Down
5 changes: 2 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use anyhow::{anyhow, Result};

use std::io;
use std::io::{self, IsTerminal};
use std::io::{Read, Write};
use std::path::Path;
extern crate base64;
Expand All @@ -12,7 +12,6 @@ use clap::Command;
extern crate crc;
extern crate hex;
extern crate percent_encoding;
use atty::Stream;

mod applet;
use applet::Applet;
Expand Down Expand Up @@ -190,7 +189,7 @@ fn main() -> Result<()> {
};

/* Only add a newline when outputing to a terminal */
if atty::is(Stream::Stdout) {
if std::io::stdout().is_terminal() {
println!();
}
}
Expand Down

0 comments on commit 68f21ce

Please sign in to comment.