mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Add a Zero trait that doesn't require Add, and use it in place of num_traits and IsZeroLength.
Use it to be consistent in InsetRect serialization and storage between Servo and Gecko. Differential Revision: https://phabricator.services.mozilla.com/D21493
This commit is contained in:
parent
4496411edc
commit
7d01114cbf
29 changed files with 179 additions and 186 deletions
|
@ -101,6 +101,11 @@ impl Angle {
|
|||
}
|
||||
}
|
||||
|
||||
/// Return `0deg`.
|
||||
pub fn zero() -> Self {
|
||||
Self::from_degrees(0.0, false)
|
||||
}
|
||||
|
||||
/// Returns the value of the angle in degrees, mostly for `calc()`.
|
||||
#[inline]
|
||||
pub fn degrees(&self) -> CSSFloat {
|
||||
|
@ -113,12 +118,6 @@ impl Angle {
|
|||
self.was_calc
|
||||
}
|
||||
|
||||
/// Returns `0deg`.
|
||||
#[inline]
|
||||
pub fn zero() -> Self {
|
||||
Self::from_degrees(0.0, false)
|
||||
}
|
||||
|
||||
/// Returns an `Angle` parsed from a `calc()` expression.
|
||||
pub fn from_calc(degrees: CSSFloat) -> Self {
|
||||
Angle {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue