33 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44
55use std:: i32;
6- use std:: ascii:: to_ascii_lower;
6+ use std:: ascii:: StrAsciiExt ;
7+
78use ast:: * ;
89
910
@@ -19,7 +20,7 @@ pub fn parse_nth(input: &[ComponentValue]) -> Option<(i32, i32)> {
1920 } ,
2021 Some ( & Dimension ( ref value, ref unit) ) => match value. int_value {
2122 Some ( a) => {
22- let unit: & str = to_ascii_lower ( unit. as_slice ( ) ) ;
23+ let unit: & str = unit. as_slice ( ) . to_ascii_lower ( ) ;
2324 match unit {
2425 "n" => parse_b ( iter, a as i32 ) ,
2526 "n-" => parse_signless_b ( iter, a as i32 , -1 ) ,
@@ -32,7 +33,7 @@ pub fn parse_nth(input: &[ComponentValue]) -> Option<(i32, i32)> {
3233 _ => None ,
3334 } ,
3435 Some ( & Ident ( ref value) ) => {
35- let ident: & str = to_ascii_lower ( value. as_slice ( ) ) ;
36+ let ident: & str = value. as_slice ( ) . to_ascii_lower ( ) ;
3637 match ident {
3738 "even" => parse_end ( iter, 2 , 0 ) ,
3839 "odd" => parse_end ( iter, 2 , 1 ) ,
@@ -52,7 +53,7 @@ pub fn parse_nth(input: &[ComponentValue]) -> Option<(i32, i32)> {
5253 } ,
5354 Some ( & Delim ( '+' ) ) => match iter. iter_with_whitespace . next ( ) {
5455 Some ( & Ident ( ref value) ) => {
55- let ident: & str = to_ascii_lower ( value. as_slice ( ) ) ;
56+ let ident: & str = value. as_slice ( ) . to_ascii_lower ( ) ;
5657 match ident {
5758 "n" => parse_b ( iter, 1 ) ,
5859 "n-" => parse_signless_b ( iter, 1 , -1 ) ,
0 commit comments