Skip to content

Commit dd0baf7

Browse files
committed
Fix up remaining usage of to_ascii.
1 parent c82e59d commit dd0baf7

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

src/compiletest/runtest.rs

+3-14
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ use util::logv;
2121
#[cfg(target_os = "windows")]
2222
use util;
2323

24+
#[cfg(target_os = "windows")]
25+
use std::ascii::AsciiExt;
2426
use std::io::File;
2527
use std::io::fs::PathExtensions;
2628
use 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)]

0 commit comments

Comments
 (0)