diff options
| author | Simon Sapin <simon.sapin@exyr.org> | 2014-12-07 01:55:34 +0000 |
|---|---|---|
| committer | Simon Sapin <simon.sapin@exyr.org> | 2014-12-25 12:19:37 +0100 |
| commit | 3a6ccdc263d9a169c2d317a6f78664e1f18d3b15 (patch) | |
| tree | b8a6d0b4ee3fdf62acf30ef38106306d3421ff61 /src/libstd/path | |
| parent | 1e5811ef9271644db0d0ddaae351976b0d4abdd2 (diff) | |
| download | rust-3a6ccdc263d9a169c2d317a6f78664e1f18d3b15.tar.gz rust-3a6ccdc263d9a169c2d317a6f78664e1f18d3b15.zip | |
Remove Ascii, AsciiCast, OwnedAsciiCast, AsciiStr, IntoBytes, IntoString.
As a replacement, add is_ascii() to AsciiExt, and implement AsciiExt for u8 and char. [breaking-change]
Diffstat (limited to 'src/libstd/path')
| -rw-r--r-- | src/libstd/path/windows.rs | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs index 7d10188c437..83eddbc5da8 100644 --- a/src/libstd/path/windows.rs +++ b/src/libstd/path/windows.rs @@ -14,7 +14,7 @@ use self::PathPrefix::*; -use ascii::AsciiCast; +use ascii::AsciiExt; use c_str::{CString, ToCStr}; use clone::Clone; use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering}; @@ -237,10 +237,10 @@ impl GenericPathUnsafe for Path { let repr = me.repr[]; match me.prefix { Some(DiskPrefix) => { - repr.as_bytes()[0] == path.as_bytes()[0].to_ascii().to_uppercase().as_byte() + repr.as_bytes()[0] == path.as_bytes()[0].to_ascii_uppercase() } Some(VerbatimDiskPrefix) => { - repr.as_bytes()[4] == path.as_bytes()[0].to_ascii().to_uppercase().as_byte() + repr.as_bytes()[4] == path.as_bytes()[0].to_ascii_uppercase() } _ => false } @@ -673,17 +673,17 @@ impl Path { match (self.prefix, other.prefix) { (Some(DiskPrefix), Some(VerbatimDiskPrefix)) => { self.is_absolute() && - s_repr.as_bytes()[0].to_ascii().to_lowercase() == - o_repr.as_bytes()[4].to_ascii().to_lowercase() + s_repr.as_bytes()[0].to_ascii_lowercase() == + o_repr.as_bytes()[4].to_ascii_lowercase() } (Some(VerbatimDiskPrefix), Some(DiskPrefix)) => { other.is_absolute() && - s_repr.as_bytes()[4].to_ascii().to_lowercase() == - o_repr.as_bytes()[0].to_ascii().to_lowercase() + s_repr.as_bytes()[4].to_ascii_lowercase() == + o_repr.as_bytes()[0].to_ascii_lowercase() } (Some(VerbatimDiskPrefix), Some(VerbatimDiskPrefix)) => { - s_repr.as_bytes()[4].to_ascii().to_lowercase() == - o_repr.as_bytes()[4].to_ascii().to_lowercase() + s_repr.as_bytes()[4].to_ascii_lowercase() == + o_repr.as_bytes()[4].to_ascii_lowercase() } (Some(UNCPrefix(_,_)), Some(VerbatimUNCPrefix(_,_))) => { s_repr[2..self.prefix_len()] == o_repr[8..other.prefix_len()] @@ -750,7 +750,7 @@ impl Path { let mut s = String::from_str(s[0..len]); unsafe { let v = s.as_mut_vec(); - v[0] = (*v)[0].to_ascii().to_uppercase().as_byte(); + v[0] = (*v)[0].to_ascii_uppercase(); } if is_abs { // normalize C:/ to C:\ @@ -765,7 +765,7 @@ impl Path { let mut s = String::from_str(s[0..len]); unsafe { let v = s.as_mut_vec(); - v[4] = (*v)[4].to_ascii().to_uppercase().as_byte(); + v[4] = (*v)[4].to_ascii_uppercase(); } Some(s) } @@ -786,14 +786,12 @@ impl Path { let mut s = String::with_capacity(n); match prefix { Some(DiskPrefix) => { - s.push(prefix_.as_bytes()[0].to_ascii() - .to_uppercase().as_char()); + s.push(prefix_.as_bytes()[0].to_ascii_uppercase() as char); s.push(':'); } Some(VerbatimDiskPrefix) => { s.push_str(prefix_[0..4]); - s.push(prefix_.as_bytes()[4].to_ascii() - .to_uppercase().as_char()); + s.push(prefix_.as_bytes()[4].to_ascii_uppercase() as char); s.push_str(prefix_[5..]); } Some(UNCPrefix(a,b)) => { |
