diff options
| author | Philipp Hansch <dev@phansch.net> | 2019-05-17 07:41:25 +0200 |
|---|---|---|
| committer | Philipp Hansch <dev@phansch.net> | 2019-05-17 07:41:25 +0200 |
| commit | 619a2906f850cb109ce8d59ea8863395c2ebe712 (patch) | |
| tree | 864faa9c5abde10169505c6b156d5595bdb71264 /clippy_dev/src | |
| parent | d9a8a8a778e33f2ce3cd18fad0da112ae713e602 (diff) | |
| download | rust-619a2906f850cb109ce8d59ea8863395c2ebe712.tar.gz rust-619a2906f850cb109ce8d59ea8863395c2ebe712.zip | |
Collect at callsite, use eprintln instead of println
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> { |
