Update ascii functions used elsewhere

This commit is contained in:
Adolfo Ochagavía 2014-05-24 14:44:10 +02:00
parent f7ccae5f15
commit e998958672
2 changed files with 6 additions and 6 deletions

View File

@ -819,7 +819,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
let i = s.chars();
let c : Vec<char> = i.map( |c| {
if c.is_ascii() {
c.to_ascii().to_lower().to_char()
c.to_ascii().to_lowercase().to_char()
} else {
c
}

View File

@ -553,18 +553,18 @@ fn in_char_specifiers(specifiers: &[CharSpecifier], c: char, options: MatchOptio
// FIXME: work with non-ascii chars properly (issue #1347)
if !options.case_sensitive && c.is_ascii() && start.is_ascii() && end.is_ascii() {
let start = start.to_ascii().to_lower();
let end = end.to_ascii().to_lower();
let start = start.to_ascii().to_lowercase();
let end = end.to_ascii().to_lowercase();
let start_up = start.to_upper();
let end_up = end.to_upper();
let start_up = start.to_uppercase();
let end_up = end.to_uppercase();
// only allow case insensitive matching when
// both start and end are within a-z or A-Z
if start != start_up && end != end_up {
let start = start.to_char();
let end = end.to_char();
let c = c.to_ascii().to_lower().to_char();
let c = c.to_ascii().to_lowercase().to_char();
if c >= start && c <= end {
return true;
}