style: Refactor media feature expression representation in preparation to support multi-range syntax

No behavior change.

Depends on D145229

Differential Revision: https://phabricator.services.mozilla.com/D145230
This commit is contained in:
Emilio Cobos Álvarez 2023-08-12 00:16:43 +02:00 committed by Martin Robinson
parent 990de9ceaa
commit f545a473ff
2 changed files with 159 additions and 127 deletions

View file

@ -72,6 +72,16 @@ impl ComputeSquaredDistance for Ratio {
}
}
impl Zero for Ratio {
fn zero() -> Self {
Self::new(Zero::zero(), One::one())
}
fn is_zero(&self) -> bool {
self.0.is_zero()
}
}
impl Ratio {
/// Returns a new Ratio.
#[inline]