File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -333,6 +333,7 @@ pub fn check(path: &Path, bad: &mut bool) {
333333 . case_insensitive ( true )
334334 . build ( )
335335 . unwrap ( ) ;
336+ let style_file = Path :: new ( file ! ( ) ) ;
336337 walk ( path, skip, & mut |entry, contents| {
337338 let file = entry. path ( ) ;
338339 let filename = file. file_name ( ) . unwrap ( ) . to_string_lossy ( ) ;
@@ -400,7 +401,7 @@ pub fn check(path: &Path, bad: &mut bool) {
400401 let mut comment_block: Option < ( usize , usize ) > = None ;
401402 let is_test = file. components ( ) . any ( |c| c. as_os_str ( ) == "tests" )
402403 || file. file_stem ( ) . unwrap ( ) == "tests" ;
403- let is_style = file. ends_with ( file ! ( ) ) ;
404+ let is_style = file. ends_with ( style_file ) || style_file . ends_with ( file ) ;
404405 // scanning the whole file for multiple needles at once is more efficient than
405406 // executing lines times needles separate searches.
406407 let any_problematic_line = !is_style && !is_test && problematic_regex. is_match ( contents) ;
You can’t perform that action at this time.
0 commit comments