Bug 1821514 - Fix a couple minor issues with the previous patch. r=CanadaHonk

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:
Emilio Cobos Álvarez 2023-03-13 17:49:57 +00:00
parent dd00a0c918
commit bd6c2daf15
2 changed files with 2 additions and 20 deletions

View File

@ -248,7 +248,7 @@ impl CSSPixelLength {
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]
pub fn finite(self) -> Self {
Self::new(crate::values::normalize(self.0).min(f32::MAX).max(f32::MIN))

View File

@ -22,7 +22,7 @@ use crate::{Zero, ZeroNoPercent};
use app_units::Au;
use cssparser::{Parser, Token};
use std::cmp;
use std::ops::{Add, Mul, Sub};
use std::ops::Mul;
use style_traits::values::specified::AllowedNumericType;
use std::fmt::{self, Write};
use style_traits::{ParseError, SpecifiedValueInfo, StyleParseErrorKind, CssWriter, ToCss};
@ -794,24 +794,6 @@ fn are_container_queries_enabled() -> bool {
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
///
/// <https://drafts.csswg.org/css-values/#lengths>