Fix future illegal_floating_point_literal_pattern warnings.

They make component/style fail to build, because of `#[deny(warnings)]`
This commit is contained in:
Simon Sapin 2017-05-12 16:12:17 +02:00
parent 58253f545b
commit 8c9e5d9f9d
4 changed files with 23 additions and 19 deletions

View file

@ -221,8 +221,9 @@ impl LengthOrPercentage {
pub fn is_definitely_zero(&self) -> bool {
use self::LengthOrPercentage::*;
match *self {
Length(Au(0)) | Percentage(0.0) => true,
Length(_) | Percentage(_) | Calc(_) => false
Length(Au(0)) => true,
Percentage(p) => p == 0.0,
Length(_) | Calc(_) => false
}
}
@ -312,8 +313,9 @@ impl LengthOrPercentageOrAuto {
pub fn is_definitely_zero(&self) -> bool {
use self::LengthOrPercentageOrAuto::*;
match *self {
Length(Au(0)) | Percentage(0.0) => true,
Length(_) | Percentage(_) | Calc(_) | Auto => false
Length(Au(0)) => true,
Percentage(p) => p == 0.0,
Length(_) | Calc(_) | Auto => false
}
}
}