From 52f1a680d51f0dda74af5759c0e221eb68db0839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 13 Mar 2023 17:49:57 +0000 Subject: [PATCH] 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 --- components/style/values/computed/length.rs | 2 +- components/style/values/specified/length.rs | 20 +------------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/components/style/values/computed/length.rs b/components/style/values/computed/length.rs index e314343702d..1c681a5607e 100644 --- a/components/style/values/computed/length.rs +++ b/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/components/style/values/specified/length.rs b/components/style/values/specified/length.rs index b1334ee69b6..c7cede33773 100644 --- a/components/style/values/specified/length.rs +++ b/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 /// ///