File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
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:: 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
} ;
You can’t perform that action at this time.
0 commit comments