diff options
author | sharkdp <davidpeter@web.de> | 2019-09-20 23:22:22 +0200 |
---|---|---|
committer | David Peter <sharkdp@users.noreply.github.com> | 2019-09-20 23:28:01 +0200 |
commit | 981481db9b4aca66258e2dd8d5377c1026a9c911 (patch) | |
tree | be059e15850cdeacbb9b5fe5f53231e76edf8e6f | |
parent | da731abb2b42b05e540f90d3b403c51b955b75d2 (diff) |
Always print warning in case of errors
-rw-r--r-- | src/main.rs | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/main.rs b/src/main.rs index 48badfd..d4dc1d7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,13 +15,6 @@ use humansize::{file_size_opts, FileSize}; use walk::Walk; fn print_result(size: u64, errors: &[walk::Err], verbose: bool) { - let tainted = errors.iter().any(|x| { - if let walk::Err::NoMetadataForPath(_) = x { - true - } else { - false - } - }); println!( "{} ({} bytes)", size.file_size(file_size_opts::DECIMAL).unwrap(), @@ -44,8 +37,10 @@ fn print_result(size: u64, errors: &[walk::Err], verbose: bool) { } } } - } else if tainted { - println!("Warning, results may be tainted. Try running with --verbose."); + } else if !errors.is_empty() { + eprintln!( + "Warning: the results may be tainted. Re-run with -v/--verbose to print all errors." + ); } } |