File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -11,18 +11,18 @@ const LIMIT: usize = 320;
11
11
12
12
pub fn check ( ) {
13
13
let stderr_files = stderr_files ( ) ;
14
- let exceeding_files = exceeding_stderr_files ( stderr_files) ;
14
+ let exceeding_files = exceeding_stderr_files ( stderr_files) . collect :: < Vec < String > > ( ) ;
15
15
16
16
if !exceeding_files. is_empty ( ) {
17
- println ! ( "Error: stderr files exceeding limit of {} lines:" , LIMIT ) ;
17
+ eprintln ! ( "Error: stderr files exceeding limit of {} lines:" , LIMIT ) ;
18
18
for path in exceeding_files {
19
19
println ! ( "{}" , path) ;
20
20
}
21
21
std:: process:: exit ( 1 ) ;
22
22
}
23
23
}
24
24
25
- fn exceeding_stderr_files ( files : impl Iterator < Item = walkdir:: DirEntry > ) -> Vec < String > {
25
+ fn exceeding_stderr_files ( files : impl Iterator < Item = walkdir:: DirEntry > ) -> impl Iterator < Item = String > {
26
26
files
27
27
. filter_map ( |file| {
28
28
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
33
33
None
34
34
}
35
35
} )
36
- . collect ( )
37
36
}
38
37
39
38
fn stderr_files ( ) -> impl Iterator < Item = walkdir:: DirEntry > {
You can’t perform that action at this time.
0 commit comments