Removed ascii functions from other modules
Replaced str::to_lowercase and str::to_uppercase
This commit is contained in:
parent
e26f992d5e
commit
dd74807957
11 changed files with 43 additions and 89 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue