File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ use util::logv;
2121#[ cfg( target_os = "windows" ) ]
2222use util;
2323
24+ #[ cfg( target_os = "windows" ) ]
25+ use std:: ascii:: AsciiExt ;
2426use std:: io:: File ;
2527use std:: io:: fs:: PathExtensions ;
2628use std:: io:: fs;
@@ -985,22 +987,9 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
985987 format ! ( "{}:{}:" , testfile. display( ) , ee. line)
986988 } ) . collect :: < Vec < String > > ( ) ;
987989
988- #[ cfg( target_os = "windows" ) ]
989- fn to_lower ( s : & str ) -> String {
990- let i = s. chars ( ) ;
991- let c : Vec < char > = i. map ( |c| {
992- if c. is_ascii ( ) {
993- c. to_ascii ( ) . to_lowercase ( ) . as_char ( )
994- } else {
995- c
996- }
997- } ) . collect ( ) ;
998- String :: from_chars ( c. as_slice ( ) )
999- }
1000-
1001990 #[ cfg( windows) ]
1002991 fn prefix_matches ( line : & str , prefix : & str ) -> bool {
1003- to_lower ( line) . as_slice ( ) . starts_with ( to_lower ( prefix) . as_slice ( ) )
992+ line. to_ascii_lowercase ( ) . starts_with ( prefix. to_ascii_lowercase ( ) . as_slice ( ) )
1004993 }
1005994
1006995 #[ cfg( unix) ]
You can’t perform that action at this time.
0 commit comments