Skip to content

Commit

Permalink
Replace yansi::Paint with Paint
Browse files Browse the repository at this point in the history
  • Loading branch information
acuteenvy committed Oct 20, 2023
1 parent d2ab879 commit 69a6886
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ fn main() -> ExitCode {

fn init_color(color_mode: ColorChoice) {
#[cfg(target_os = "windows")]
let color_support = yansi::Paint::enable_windows_ascii();
let color_support = Paint::enable_windows_ascii();
#[cfg(not(target_os = "windows"))]
let color_support = true;

match color_mode {
ColorChoice::Always => {}
ColorChoice::Never => yansi::Paint::disable(),
ColorChoice::Never => Paint::disable(),
ColorChoice::Auto => {
if !(color_support && env::var_os("NO_COLOR").is_none() && io::stdout().is_terminal()) {
yansi::Paint::disable();
Paint::disable();
}
}
}
Expand Down

0 comments on commit 69a6886

Please sign in to comment.