diff options
Diffstat (limited to 'clippy_dev/src')
| -rw-r--r-- | clippy_dev/src/stderr_length_check.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clippy_dev/src/stderr_length_check.rs b/clippy_dev/src/stderr_length_check.rs index 9222ed84167..6c5107aebfd 100644 --- a/clippy_dev/src/stderr_length_check.rs +++ b/clippy_dev/src/stderr_length_check.rs @@ -11,10 +11,10 @@ const LIMIT: usize = 320; pub fn check() { let stderr_files = stderr_files(); - let exceeding_files = exceeding_stderr_files(stderr_files); + let exceeding_files = exceeding_stderr_files(stderr_files).collect::<Vec<String>>(); if !exceeding_files.is_empty() { - println!("Error: stderr files exceeding limit of {} lines:", LIMIT); + eprintln!("Error: stderr files exceeding limit of {} lines:", LIMIT); for path in exceeding_files { println!("{}", path); } @@ -22,7 +22,7 @@ pub fn check() { } } -fn exceeding_stderr_files(files: impl Iterator<Item = walkdir::DirEntry>) -> Vec<String> { +fn exceeding_stderr_files(files: impl Iterator<Item = walkdir::DirEntry>) -> impl Iterator<Item = String> { files .filter_map(|file| { let path = file.path().to_str().expect("Could not convert path to str").to_string(); @@ -33,7 +33,6 @@ fn exceeding_stderr_files(files: impl Iterator<Item = walkdir::DirEntry>) -> Vec None } }) - .collect() } fn stderr_files() -> impl Iterator<Item = walkdir::DirEntry> { |
