mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Fix a couple minor issues with the previous patch
Having unused imports and undocumented functions trigger warnings that don't build in automation. Differential Revision: https://phabricator.services.mozilla.com/D172429
This commit is contained in:
parent
571f8a8dd5
commit
52f1a680d5
2 changed files with 2 additions and 20 deletions
|
@ -248,7 +248,7 @@ impl CSSPixelLength {
|
||||||
Self::new(crate::values::normalize(self.0))
|
Self::new(crate::values::normalize(self.0))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns a finite (normalized and clamped to float min and max) version of this length.
|
/// Returns a finite (normalized and clamped to float min and max) version of this length.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn finite(self) -> Self {
|
pub fn finite(self) -> Self {
|
||||||
Self::new(crate::values::normalize(self.0).min(f32::MAX).max(f32::MIN))
|
Self::new(crate::values::normalize(self.0).min(f32::MAX).max(f32::MIN))
|
||||||
|
|
|
@ -22,7 +22,7 @@ use crate::{Zero, ZeroNoPercent};
|
||||||
use app_units::Au;
|
use app_units::Au;
|
||||||
use cssparser::{Parser, Token};
|
use cssparser::{Parser, Token};
|
||||||
use std::cmp;
|
use std::cmp;
|
||||||
use std::ops::{Add, Mul, Sub};
|
use std::ops::Mul;
|
||||||
use style_traits::values::specified::AllowedNumericType;
|
use style_traits::values::specified::AllowedNumericType;
|
||||||
use std::fmt::{self, Write};
|
use std::fmt::{self, Write};
|
||||||
use style_traits::{ParseError, SpecifiedValueInfo, StyleParseErrorKind, CssWriter, ToCss};
|
use style_traits::{ParseError, SpecifiedValueInfo, StyleParseErrorKind, CssWriter, ToCss};
|
||||||
|
@ -794,24 +794,6 @@ fn are_container_queries_enabled() -> bool {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Sub<AbsoluteLength> for AbsoluteLength {
|
|
||||||
type Output = Self;
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn sub(self, rhs: Self) -> Self {
|
|
||||||
match (self, rhs) {
|
|
||||||
(AbsoluteLength::Px(x), AbsoluteLength::Px(y)) => AbsoluteLength::Px(x - y),
|
|
||||||
(AbsoluteLength::In(x), AbsoluteLength::In(y)) => AbsoluteLength::In(x - y),
|
|
||||||
(AbsoluteLength::Cm(x), AbsoluteLength::Cm(y)) => AbsoluteLength::Cm(x - y),
|
|
||||||
(AbsoluteLength::Mm(x), AbsoluteLength::Mm(y)) => AbsoluteLength::Mm(x - y),
|
|
||||||
(AbsoluteLength::Q(x), AbsoluteLength::Q(y)) => AbsoluteLength::Q(x - y),
|
|
||||||
(AbsoluteLength::Pt(x), AbsoluteLength::Pt(y)) => AbsoluteLength::Pt(x - y),
|
|
||||||
(AbsoluteLength::Pc(x), AbsoluteLength::Pc(y)) => AbsoluteLength::Pc(x - y),
|
|
||||||
_ => AbsoluteLength::Px(self.to_px() - rhs.to_px()),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// A `<length>` without taking `calc` expressions into account
|
/// A `<length>` without taking `calc` expressions into account
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-values/#lengths>
|
/// <https://drafts.csswg.org/css-values/#lengths>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue