24
24
html_favicon_url = "http://www.rust-lang.org/favicon.ico" ,
25
25
html_root_url = "http://doc.rust-lang.org/glob/" ) ]
26
26
27
+ use std:: ascii:: AsciiExt ;
27
28
use std:: cell:: Cell ;
28
29
use std:: { cmp, os, path} ;
29
30
use std:: io:: fs:: { mod, PathExtensions } ;
@@ -547,18 +548,16 @@ fn in_char_specifiers(specifiers: &[CharSpecifier], c: char, options: &MatchOpti
547
548
// FIXME: work with non-ascii chars properly (issue #1347)
548
549
if !options. case_sensitive && c. is_ascii ( ) && start. is_ascii ( ) && end. is_ascii ( ) {
549
550
550
- let start = start. to_ascii ( ) . to_lowercase ( ) ;
551
- let end = end. to_ascii ( ) . to_lowercase ( ) ;
551
+ let start = start. to_ascii_lowercase ( ) ;
552
+ let end = end. to_ascii_lowercase ( ) ;
552
553
553
554
let start_up = start. to_uppercase ( ) ;
554
555
let end_up = end. to_uppercase ( ) ;
555
556
556
557
// only allow case insensitive matching when
557
558
// both start and end are within a-z or A-Z
558
559
if start != start_up && end != end_up {
559
- let start = start. as_char ( ) ;
560
- let end = end. as_char ( ) ;
561
- let c = c. to_ascii ( ) . to_lowercase ( ) . as_char ( ) ;
560
+ let c = c. to_ascii_lowercase ( ) ;
562
561
if c >= start && c <= end {
563
562
return true ;
564
563
}
@@ -581,7 +580,7 @@ fn chars_eq(a: char, b: char, case_sensitive: bool) -> bool {
581
580
true
582
581
} else if !case_sensitive && a. is_ascii ( ) && b. is_ascii ( ) {
583
582
// FIXME: work with non-ascii chars properly (issue #9084)
584
- a. to_ascii ( ) . to_lowercase ( ) == b. to_ascii ( ) . to_lowercase ( )
583
+ a. to_ascii_lowercase ( ) == b. to_ascii_lowercase ( )
585
584
} else {
586
585
a == b
587
586
}
0 commit comments