fix usage of debug formatters
This commit is contained in:
@@ -23,7 +23,7 @@ impl Config {
|
||||
|
||||
if let Err(e) = from_file {
|
||||
if e.kind() == ErrorKind::NotFound {
|
||||
println!("creating default config under {file:?}");
|
||||
println!("creating default config under {}", file.to_string_lossy());
|
||||
return Self::use_default_and_save_to(file);
|
||||
} else {
|
||||
bail!("unexpected error occured: {e:?}");
|
||||
|
||||
@@ -313,7 +313,10 @@ fn show_error(error: &anyhow::Error, backend: &dyn Backend) {
|
||||
match get_single_var("RUST_BACKTRACE") {
|
||||
Some(s) => {
|
||||
if s == "1" || s == "full" {
|
||||
println!("WARNING: skipping backend '{section}': {error:?}\n");
|
||||
eprintln!("WARNING: skipping backend '{section}':");
|
||||
for err in error.chain() {
|
||||
eprintln!(" {err}");
|
||||
}
|
||||
}
|
||||
}
|
||||
None => println!("WARNING: skipping backend '{section}': {error}"),
|
||||
|
||||
@@ -27,7 +27,10 @@ impl Group {
|
||||
let path = file.path();
|
||||
|
||||
if config.warn_not_symlinks && !path.is_symlink() {
|
||||
println!("WARNING: group file {path:?} is not a symlink");
|
||||
println!(
|
||||
"WARNING: group file {} is not a symlink",
|
||||
path.to_string_lossy()
|
||||
);
|
||||
}
|
||||
|
||||
let group =
|
||||
@@ -88,12 +91,14 @@ impl Group {
|
||||
let mut sections = HashSet::new();
|
||||
|
||||
while lines.peek().is_some() {
|
||||
match Section::try_from_lines(&mut lines).context("reading section") {
|
||||
let result = Section::try_from_lines(&mut lines).context("reading section");
|
||||
match result {
|
||||
Ok(section) => {
|
||||
sections.insert(section);
|
||||
}
|
||||
Err(e) => {
|
||||
println!("WARNING: could not process a section under group '{name}': {e:?}\n");
|
||||
let err = e.root_cause();
|
||||
println!("WARNING: could not process a section under group '{name}': {err}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ impl Section {
|
||||
}
|
||||
}
|
||||
|
||||
ensure!(!packages.is_empty());
|
||||
ensure!(!packages.is_empty(), "[{name}] is empty");
|
||||
|
||||
Ok(Self::new(name, packages))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user