diff --git a/Cargo.lock b/Cargo.lock index ccebcaa5..f8919d00 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -300,17 +300,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 = "autocfg" version = "1.5.0" @@ -1315,7 +1304,6 @@ dependencies = [ "async-openai", "async-stream", "async-trait", - "atty", "aws-config", "aws-sdk-s3", "aws-sdk-sqs", @@ -2685,15 +2673,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.5.2" @@ -3604,7 +3583,7 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" dependencies = [ - "hermit-abi 0.5.2", + "hermit-abi", "libc", ] @@ -4006,7 +3985,7 @@ checksum = "b5bd19146350fe804f7cb2669c851c03d69da628803dab0d98018142aaa5d829" dependencies = [ "cfg-if", "concurrent-queue", - "hermit-abi 0.5.2", + "hermit-abi", "pin-project-lite", "rustix 1.0.8", "windows-sys 0.60.2", @@ -6471,28 +6450,6 @@ dependencies = [ "wasite", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-core" version = "0.61.2" diff --git a/src/execution/stats.rs b/src/execution/stats.rs index d15d291e..4dab89fc 100644 --- a/src/execution/stats.rs +++ b/src/execution/stats.rs @@ -1,16 +1,10 @@ use crate::prelude::*; -use owo_colors::{AnsiColors, OwoColorize}; use std::{ ops::AddAssign, sync::atomic::{AtomicI64, Ordering::Relaxed}, }; -/// Check if stdout is a TTY -fn is_stdout_tty() -> bool { - atty::is(atty::Stream::Stdout) -} - #[derive(Default, Serialize)] pub struct Counter(pub AtomicI64); @@ -235,16 +229,7 @@ impl std::fmt::Display for UpdateStats { // Error handling if num_errors > 0 { - let tty = is_stdout_tty(); - if tty { - write!( - f, - "{}", - format!("{} rows failed", num_errors).color(AnsiColors::White) - )?; - } else { - write!(f, "{} rows failed", num_errors)?; - } + write!(f, "{} rows failed", num_errors)?; if !segments.is_empty() { write!(f, "; ")?; } @@ -297,19 +282,8 @@ impl std::fmt::Display for UpdateStats { if remaining_width > 0 { bar.push_str(&" ".repeat(remaining_width)); } - let tty = is_stdout_tty(); // Use total from current operations - this represents the actual record count - if tty { - write!( - f, - "[{}] {}/{} records ", - bar.color(AnsiColors::BrightBlack), - total - num_in_process, - total - )?; - } else { - write!(f, "[{}] {}/{} records ", bar, total - num_in_process, total)?; - } + write!(f, "[{}] {}/{} records ", bar, total - num_in_process, total)?; // Add segment labels with different grey shades for each segment type let mut first = true; @@ -318,16 +292,7 @@ impl std::fmt::Display for UpdateStats { if !first { write!(f, " ")?; } - if tty { - match *segment_type { - "+" => write!(f, "{}", label.color(AnsiColors::BrightBlack))?, // Lightest grey for additions - "-" => write!(f, "{}", label.color(AnsiColors::White))?, // White for removals - "~" => write!(f, "{}", label.color(AnsiColors::Black))?, // Dark grey for updates - _ => write!(f, "{}", label.color(AnsiColors::Black))?, // Black for no-change - } - } else { - write!(f, "{}", label)?; - } + write!(f, "{}", label)?; first = false; } } @@ -340,16 +305,7 @@ impl std::fmt::Display for UpdateStats { if !segments.is_empty() { write!(f, " ")?; } - let tty = is_stdout_tty(); - if tty { - write!( - f, - "{}", - format!("({} in process)", num_in_process).color(AnsiColors::Black) - )?; - } else { - write!(f, "({} in process)", num_in_process)?; - } + write!(f, "({} in process)", num_in_process)?; } Ok(())