diff --git a/servo/components/style/values/computed/length.rs b/servo/components/style/values/computed/length.rs index 819aff7c575d..cbbac910d69a 100644 --- a/servo/components/style/values/computed/length.rs +++ b/servo/components/style/values/computed/length.rs @@ -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)) diff --git a/servo/components/style/values/specified/length.rs b/servo/components/style/values/specified/length.rs index 1b8af0280ff0..b23307c7513e 100644 --- a/servo/components/style/values/specified/length.rs +++ b/servo/components/style/values/specified/length.rs @@ -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 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 `` without taking `calc` expressions into account /// ///