diff options
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) |
