diff --git a/clippy_dev/src/stderr_length_check.rs b/clippy_dev/src/stderr_length_check.rs index 9222ed84167bb..6c5107aebfd3a 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::>(); 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) -> Vec { +fn exceeding_stderr_files(files: impl Iterator) -> impl Iterator { 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) -> Vec None } }) - .collect() } fn stderr_files() -> impl Iterator {