diff options
| author | Marvin Löbel <loebel.marvin@gmail.com> | 2013-04-23 11:08:13 +0200 |
|---|---|---|
| committer | Marvin Löbel <loebel.marvin@gmail.com> | 2013-04-24 22:26:09 +0200 |
| commit | dd748079574197215da46ac164f16a392df9cc26 (patch) | |
| tree | dc080a272f782c967a375056d48de94eb48be56b /src/libcore/path.rs | |
| parent | e26f992d5e199a1ff8c26733650d254d63be066a (diff) | |
| download | rust-dd748079574197215da46ac164f16a392df9cc26.tar.gz rust-dd748079574197215da46ac164f16a392df9cc26.zip | |
Removed ascii functions from other modules
Replaced str::to_lowercase and str::to_uppercase
Diffstat (limited to 'src/libcore/path.rs')
| -rw-r--r-- | src/libcore/path.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libcore/path.rs b/src/libcore/path.rs index 8328d42c35e..2c75bf98eb0 100644 --- a/src/libcore/path.rs +++ b/src/libcore/path.rs @@ -753,7 +753,9 @@ impl GenericPath for WindowsPath { fn is_restricted(&self) -> bool { match self.filestem() { Some(stem) => { - match stem.to_lower() { + // FIXME: 4318 Instead of to_str_ascii, could use + // to_str_consume to not do a unneccessary copy. + match stem.to_ascii().to_lower().to_str_ascii() { ~"con" | ~"aux" | ~"com1" | ~"com2" | ~"com3" | ~"com4" | ~"lpt1" | ~"lpt2" | ~"lpt3" | ~"prn" | ~"nul" => true, _ => false @@ -809,7 +811,10 @@ impl GenericPath for WindowsPath { host: copy self.host, device: match self.device { None => None, - Some(ref device) => Some(device.to_upper()) + + // FIXME: 4318 Instead of to_str_ascii, could use + // to_str_consume to not do a unneccessary copy. + Some(ref device) => Some(device.to_ascii().to_upper().to_str_ascii()) }, is_absolute: self.is_absolute, components: normalize(self.components) |
