Skip to content

Commit 5b55b42

Browse files
committed
Merge pull request #8 from metajack/rustup
Upgrade for latest rust.
2 parents 3e21799 + 4e5c369 commit 5b55b42

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*.a
33
*.so
44
*.dylib
5+
*.dSYM
56
*.dll
67
*.dummy
78
*-test

color.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

55
use std::libc::c_float;
6-
use std::ascii::to_ascii_lower;
6+
use std::ascii::StrAsciiExt;
77

88
use ast::*;
99
use self::color_data::{COLOR_KEYWORDS, COLOR_VALUES};
@@ -34,7 +34,7 @@ pub fn parse_color(component_value: &ComponentValue) -> Option<Color> {
3434

3535
#[inline]
3636
fn parse_color_keyword(value: &str) -> Option<Color> {
37-
let lower_value = to_ascii_lower(value);
37+
let lower_value = value.to_ascii_lower();
3838
match COLOR_KEYWORDS.bsearch_elem(&lower_value.as_slice()) {
3939
Some(index) => Some(COLOR_VALUES[index]),
4040
None => if "currentcolor" == lower_value { Some(CurrentColor) }
@@ -82,7 +82,7 @@ fn parse_color_hash(value: &str) -> Option<Color> {
8282
#[inline]
8383
fn parse_color_function(name: &str, arguments: &[ComponentValue])
8484
-> Option<Color> {
85-
let lower_name = to_ascii_lower(name);
85+
let lower_name = name.to_ascii_lower();
8686

8787
let (is_rgb, has_alpha) =
8888
if "rgba" == lower_name { (true, true) }

nth.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

55
use std::i32;
6-
use std::ascii::to_ascii_lower;
6+
use std::ascii::StrAsciiExt;
7+
78
use 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),

parser.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
1616

1717
use std::iterator::Iterator;
18-
use std::ascii::eq_ignore_ascii_case;
18+
use std::ascii::StrAsciiExt;
1919

2020
use ast::*;
2121

@@ -244,7 +244,7 @@ fn parse_declaration_important<T: Iterator<Node>>(iter: &mut T) -> bool {
244244
Some((Ident(value), _)) => value,
245245
_ => return false,
246246
};
247-
if !eq_ignore_ascii_case(ident_value, "important") { return false }
247+
if !ident_value.eq_ignore_ascii_case("important") { return false }
248248
match next_non_whitespace(iter) {
249249
Some((Semicolon, _)) => true,
250250
None => true,

tokenizer.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// http://dev.w3.org/csswg/css3-syntax/#tokenization
66

77
use std::{str, u32, i64, f64};
8-
use std::ascii::eq_ignore_ascii_case;
8+
use std::ascii::StrAsciiExt;
99

1010
use ast::*;
1111

@@ -361,7 +361,7 @@ fn is_ident_start(tokenizer: &mut Tokenizer) -> bool {
361361
fn consume_ident_like(tokenizer: &mut Tokenizer) -> ComponentValue {
362362
let value = consume_name(tokenizer);
363363
if !tokenizer.is_eof() && tokenizer.current_char() == '(' {
364-
if eq_ignore_ascii_case(value, "url") { consume_url(tokenizer) }
364+
if value.eq_ignore_ascii_case("url") { consume_url(tokenizer) }
365365
else { Function(value, consume_block(tokenizer, CloseParenthesis)) }
366366
} else {
367367
Ident(value)

0 commit comments

Comments
 (0)