Skip to content

Commit ac4a1cc

Browse files
authored
Merge pull request #61 from RalfJung/colored
replace ansi_term by colored
2 parents f8b86d4 + 3bd2b66 commit ac4a1cc

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

Cargo.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ is-it-maintained-issue-resolution = { repository = "kennytm/rustup-toolchain-ins
1717
is-it-maintained-open-issues = { repository = "kennytm/rustup-toolchain-install-master" }
1818

1919
[dependencies]
20-
ansi_term = "0.12"
20+
colored = "3"
2121
anyhow = "1.0.31"
2222
home = "0.5"
2323
pbr = "1.1"

src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::process::exit;
1010
use std::process::Command;
1111
use std::time::Duration;
1212

13-
use ansi_term::Color::{Red, Yellow};
13+
use colored::Colorize;
1414
use anyhow::{bail, ensure, Context, Error};
1515
use clap::{crate_version, Parser};
1616
use pbr::{ProgressBar, Units};
@@ -501,17 +501,17 @@ fn run() -> Result<(), Error> {
501501
}
502502

503503
fn report_error(err: &Error) {
504-
eprintln!("{} {}", Red.bold().paint("error:"), err);
504+
eprintln!("{} {}", "error:".red().bold(), err);
505505
for cause in err.chain().skip(1) {
506-
eprintln!("{} {}", Red.bold().paint("caused by:"), cause);
506+
eprintln!("{} {}", "caused by:".red().bold(), cause);
507507
}
508508
exit(1);
509509
}
510510

511511
fn report_warn(warn: &Error) {
512-
eprintln!("{} {}", Yellow.bold().paint("warn:"), warn);
512+
eprintln!("{} {}", "warn:".yellow().bold(), warn);
513513
for cause in warn.chain().skip(1) {
514-
eprintln!("{} {}", Yellow.bold().paint("caused by:"), cause);
514+
eprintln!("{} {}", "caused by:".yellow().bold(), cause);
515515
}
516516
eprintln!();
517517
}

0 commit comments

Comments
 (0)