From 8813605e5fbc89367b3f7a55fbc2e09a620de0ce Mon Sep 17 00:00:00 2001 From: Hiers Date: Sun, 18 Feb 2024 11:20:54 +0000 Subject: [PATCH] Was using atty when it's available in the stdlib. --- Cargo.toml | 1 - src/main.rs | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2184af8..34e7ddc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,6 @@ libc = "0.2.151" ureq = { version = "2.8.0", features = ["json"] } serde_json = "1.0.108" argparse = "0.2.2" -atty = "0.2.14" kradical_parsing = "0.1.0" [features] diff --git a/src/main.rs b/src/main.rs index b1bc71c..a23139a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,7 @@ mod kanji_search; mod sentence_search; mod util; use std::{ - io::{stdin, stdout, Write}, + io::{stdin, stdout, Write, IsTerminal}, path::PathBuf, process::{Command, Stdio}, env, @@ -16,7 +16,6 @@ use sentence_search::sentence_search; use argparse::{ArgumentParser, List, Print, Store, StoreTrue}; use serde_json::Value; -use atty::Stream; use kradical_parsing::radk; macro_rules! JISHO_URL { @@ -35,7 +34,7 @@ macro_rules! TATOEBA_URL_JPN_QUERY { () => { fn main() -> Result<(), ureq::Error> { - let term_size = if atty::is(Stream::Stdout) { + let term_size = if stdout().is_terminal() { terminal_size().unwrap_or(0) } else { 0