Skip to content

Commit 6e2f5ec

Browse files
committed
Merge pull request servo#39 from mozilla-servo/rustup_20140321
Update to current rust
2 parents abe576a + 131b8e7 commit 6e2f5ec

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

ast.rs

Lines changed: 3 additions & 3 deletions
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::fmt;
6-
use std::vec;
6+
use std::slice;
77

88

99
#[deriving(Eq)]
@@ -139,7 +139,7 @@ impl<'a> SkipWhitespaceIterable<'a> for &'a [ComponentValue] {
139139

140140
#[deriving(Clone)]
141141
pub struct SkipWhitespaceIterator<'a> {
142-
iter_with_whitespace: vec::Items<'a, ComponentValue>,
142+
iter_with_whitespace: slice::Items<'a, ComponentValue>,
143143
}
144144

145145
impl<'a> Iterator<&'a ComponentValue> for SkipWhitespaceIterator<'a> {
@@ -163,7 +163,7 @@ impl MoveSkipWhitespaceIterable for ~[ComponentValue] {
163163
}
164164

165165
pub struct MoveSkipWhitespaceIterator {
166-
iter_with_whitespace: vec::MoveItems<ComponentValue>,
166+
iter_with_whitespace: slice::MoveItems<ComponentValue>,
167167
}
168168

169169
impl Iterator<ComponentValue> for MoveSkipWhitespaceIterator {

color.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

55
use std::ascii::StrAsciiExt;
6-
use std::cmp;
76

87
use ast::*;
98

@@ -298,9 +297,9 @@ fn parse_color_function(name: &str, arguments: &[ComponentValue])
298297
let hue = expect_number!() / 360.;
299298
let hue = hue - hue.floor();
300299
expect_comma!();
301-
let saturation = cmp::min(cmp::max((expect_percentage!() / 100.), 0.), 1.);
300+
let saturation = (expect_percentage!() / 100.).min(0.).max(1.);
302301
expect_comma!();
303-
let lightness = cmp::min(cmp::max((expect_percentage!() / 100.), 0.), 1.);
302+
let lightness = (expect_percentage!() / 100.).min(0.).max(1.);
304303

305304
// http://www.w3.org/TR/css3-color/#hsl-color
306305
fn hue_to_rgb(m1: f64, m2: f64, mut h: f64) -> f64 {
@@ -322,7 +321,7 @@ fn parse_color_function(name: &str, arguments: &[ComponentValue])
322321

323322
let alpha = if has_alpha {
324323
expect_comma!();
325-
cmp::min(cmp::max((expect_number!()), 0.), 1.) as f32
324+
(expect_number!()).min(0.).max(1.) as f32
326325
} else {
327326
1.
328327
};

lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#[crate_id = "github.com/mozilla-servo/rust-cssparser#cssparser:0.1"];
66
#[feature(globs, macro_rules)];
77

8-
extern crate extra;
98
extern crate encoding; // https://github.com/lifthrasiir/rust-encoding
109

1110
#[cfg(test)]

0 commit comments

Comments
 (0)