Skip to content

Commit

Permalink
perf: migrate to owo-color
Browse files Browse the repository at this point in the history
It has fewer dependencies
  • Loading branch information
azzamsa committed Dec 28, 2022
1 parent ac2ce97 commit 64dc398
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
13 changes: 1 addition & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ lto = true
panic = 'abort'

[dependencies]
colored = "2.0"
log = "0.4"
miette = { version = "5.5", features = ["fancy"] }
owo-colors = "3"
pretty_env_logger = "0.4"
serde = { version = "1.0", features = ["derive"] }
thiserror = "1.0"
Expand Down
7 changes: 3 additions & 4 deletions src/output.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::path::PathBuf;

use colored::Colorize;
use log::trace;
use owo_colors::OwoColorize;
use trust_dns_client::rr::{Record, RecordType};

use crate::error::Error;
Expand Down Expand Up @@ -54,13 +54,12 @@ impl Printer {
}
fn print_record(record: &Record) {
let record_type = record.record_type().to_string();
let record_type = record_type.green().bold();
let name = record.name().to_string().blue();
let name = record.name().to_string();
let rdata = match record.data() {
Some(rdata) => rdata.to_string(),
None => "".to_string(),
};
let rdata = rdata.bold();
println!(" {} {} {}", record_type, name, rdata);
println!(" {} {} {}", record_type.green().bold(), name.blue(), rdata);
}
}

0 comments on commit 64dc398

Please sign in to comment.