Print errors to stderr

This commit is contained in:
Atanas Yankov 2019-05-16 22:33:50 +01:00 committed by Pierre Peltier
parent f619dc07d6
commit 79416127c8
2 changed files with 4 additions and 4 deletions

View file

@ -70,7 +70,7 @@ impl Core {
let absolute_path = match fs::canonicalize(&path) {
Ok(path) => path,
Err(err) => {
println!("couldn't access '{}': {}", path.display(), err);
eprintln!("cannot access '{}': {}", path.display(), err);
continue;
}
};
@ -81,7 +81,7 @@ impl Core {
self.flags.display,
) {
Ok(meta) => meta_list.push(meta),
Err(err) => println!("cannot access '{}': {}", path.display(), err),
Err(err) => eprintln!("cannot access '{}': {}", path.display(), err),
};
}

View file

@ -57,7 +57,7 @@ impl Meta {
}
if let Err(err) = meta.path.read_dir() {
println!("cannot access '{}': {}", path.display(), err);
eprintln!("cannot access '{}': {}", path.display(), err);
return Ok(meta);
}
let mut content = Vec::new();
@ -99,7 +99,7 @@ impl Meta {
match Self::from_path_recursive(&path.to_path_buf(), depth - 1, display) {
Ok(res) => res,
Err(err) => {
println!("cannot access '{}': {}", path.display(), err);
eprintln!("cannot access '{}': {}", path.display(), err);
continue;
}
};