File tree 3 files changed +6
-8
lines changed
3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 3
3
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
4
5
5
use std:: fmt;
6
- use std:: vec ;
6
+ use std:: slice ;
7
7
8
8
9
9
#[ deriving( Eq ) ]
@@ -139,7 +139,7 @@ impl<'a> SkipWhitespaceIterable<'a> for &'a [ComponentValue] {
139
139
140
140
#[ deriving( Clone ) ]
141
141
pub struct SkipWhitespaceIterator < ' a > {
142
- iter_with_whitespace : vec :: Items < ' a , ComponentValue > ,
142
+ iter_with_whitespace : slice :: Items < ' a , ComponentValue > ,
143
143
}
144
144
145
145
impl < ' a > Iterator < & ' a ComponentValue > for SkipWhitespaceIterator < ' a > {
@@ -163,7 +163,7 @@ impl MoveSkipWhitespaceIterable for ~[ComponentValue] {
163
163
}
164
164
165
165
pub struct MoveSkipWhitespaceIterator {
166
- iter_with_whitespace : vec :: MoveItems < ComponentValue > ,
166
+ iter_with_whitespace : slice :: MoveItems < ComponentValue > ,
167
167
}
168
168
169
169
impl Iterator < ComponentValue > for MoveSkipWhitespaceIterator {
Original file line number Diff line number Diff line change 3
3
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
4
5
5
use std:: ascii:: StrAsciiExt ;
6
- use std:: cmp;
7
6
8
7
use ast:: * ;
9
8
@@ -298,9 +297,9 @@ fn parse_color_function(name: &str, arguments: &[ComponentValue])
298
297
let hue = expect_number ! ( ) / 360. ;
299
298
let hue = hue - hue. floor ( ) ;
300
299
expect_comma ! ( ) ;
301
- let saturation = cmp :: min ( cmp :: max ( ( expect_percentage ! ( ) / 100. ) , 0. ) , 1. ) ;
300
+ let saturation = ( expect_percentage ! ( ) / 100. ) . min ( 0. ) . max ( 1. ) ;
302
301
expect_comma ! ( ) ;
303
- let lightness = cmp :: min ( cmp :: max ( ( expect_percentage ! ( ) / 100. ) , 0. ) , 1. ) ;
302
+ let lightness = ( expect_percentage ! ( ) / 100. ) . min ( 0. ) . max ( 1. ) ;
304
303
305
304
// http://www.w3.org/TR/css3-color/#hsl-color
306
305
fn hue_to_rgb ( m1 : f64 , m2 : f64 , mut h : f64 ) -> f64 {
@@ -322,7 +321,7 @@ fn parse_color_function(name: &str, arguments: &[ComponentValue])
322
321
323
322
let alpha = if has_alpha {
324
323
expect_comma ! ( ) ;
325
- cmp :: min ( cmp :: max ( ( expect_number ! ( ) ) , 0. ) , 1. ) as f32
324
+ ( expect_number ! ( ) ) . min ( 0. ) . max ( 1. ) as f32
326
325
} else {
327
326
1.
328
327
} ;
Original file line number Diff line number Diff line change 5
5
#[ crate_id = "github.com/mozilla-servo/rust-cssparser#cssparser:0.1" ] ;
6
6
#[ feature( globs, macro_rules) ] ;
7
7
8
- extern crate extra;
9
8
extern crate encoding; // https://github.com/lifthrasiir/rust-encoding
10
9
11
10
#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments