diff options
| author | Simon Sapin <simon.sapin@exyr.org> | 2014-12-25 15:26:16 +0100 |
|---|---|---|
| committer | Simon Sapin <simon.sapin@exyr.org> | 2014-12-25 15:26:16 +0100 |
| commit | dd0baf7f01fc470fb7406b785d03e24fa116ed1c (patch) | |
| tree | e9ed0478f56f6453a10a101c85ac1511906b7e89 | |
| parent | c82e59d774eb8fa98f0742105a3ed2b8f0ac702d (diff) | |
| download | rust-dd0baf7f01fc470fb7406b785d03e24fa116ed1c.tar.gz rust-dd0baf7f01fc470fb7406b785d03e24fa116ed1c.zip | |
Fix up remaining usage of `to_ascii`.
| -rw-r--r-- | src/compiletest/runtest.rs | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index bf72250c470..1abcd8bd214 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -21,6 +21,8 @@ use util::logv; #[cfg(target_os = "windows")] use util; +#[cfg(target_os = "windows")] +use std::ascii::AsciiExt; use std::io::File; use std::io::fs::PathExtensions; use std::io::fs; @@ -985,22 +987,9 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> , format!("{}:{}:", testfile.display(), ee.line) }).collect::<Vec<String> >(); - #[cfg(target_os = "windows")] - fn to_lower( s : &str ) -> String { - let i = s.chars(); - let c : Vec<char> = i.map( |c| { - if c.is_ascii() { - c.to_ascii().to_lowercase().as_char() - } else { - c - } - } ).collect(); - String::from_chars(c.as_slice()) - } - #[cfg(windows)] fn prefix_matches( line : &str, prefix : &str ) -> bool { - to_lower(line).as_slice().starts_with(to_lower(prefix).as_slice()) + line.to_ascii_lowercase().starts_with(prefix.to_ascii_lowercase().as_slice()) } #[cfg(unix)] |
