1
Fork 0

Removed ascii functions from other modules

Replaced str::to_lowercase and str::to_uppercase
This commit is contained in:
Marvin Löbel 2013-04-23 11:08:13 +02:00
parent e26f992d5e
commit dd74807957
11 changed files with 43 additions and 89 deletions

View file

@ -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)