File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change
1
+ use std:: ffi:: OsStr ;
1
2
use std:: path:: PathBuf ;
2
3
3
4
use regex:: RegexSet ;
@@ -47,7 +48,7 @@ impl Message {
47
48
. filter ( |line| regex_set. matches ( line) . matched_any ( ) )
48
49
// ignore exceptions
49
50
. filter ( |line| !exceptions_set. matches ( line) . matched_any ( ) )
50
- . map ( |s| s . to_owned ( ) )
51
+ . map ( ToOwned :: to_owned)
51
52
. collect :: < Vec < String > > ( ) ;
52
53
53
54
Message { path, bad_lines }
@@ -71,17 +72,16 @@ fn lint_message_convention() {
71
72
72
73
// gather all .stderr files
73
74
let tests = test_dirs
74
- . map ( |dir| {
75
+ . flat_map ( |dir| {
75
76
std:: fs:: read_dir ( dir)
76
77
. expect ( "failed to read dir" )
77
78
. map ( |direntry| direntry. unwrap ( ) . path ( ) )
78
79
} )
79
- . flatten ( )
80
- . filter ( |file| matches ! ( file. extension( ) . map( |s| s. to_str( ) ) , Some ( Some ( "stderr" ) ) ) ) ;
80
+ . filter ( |file| matches ! ( file. extension( ) . map( OsStr :: to_str) , Some ( Some ( "stderr" ) ) ) ) ;
81
81
82
82
// get all files that have any "bad lines" in them
83
83
let bad_tests: Vec < Message > = tests
84
- . map ( |path| Message :: new ( path ) )
84
+ . map ( Message :: new)
85
85
. filter ( |message| !message. bad_lines . is_empty ( ) )
86
86
. collect ( ) ;
87
87
You can’t perform that action at this time.
0 commit comments