style: Derive more.

Differential Revision: https://phabricator.services.mozilla.com/D17029
This commit is contained in:
Bobby Holley 2019-01-18 12:39:29 -08:00 committed by Emilio Cobos Álvarez
parent 137e735d9d
commit af1bbd7b06
8 changed files with 14 additions and 91 deletions

View file

@ -9,13 +9,12 @@ use crate::values::CSSFloat;
use num_traits::Zero;
use std::f64::consts::PI;
use std::fmt::{self, Write};
use std::ops::Add;
use std::{f32, f64};
use style_traits::{CssWriter, ToCss};
/// A computed angle in degrees.
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
#[derive(Animate, Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd, ToAnimatedZero)]
#[derive(Add, Animate, Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd, ToAnimatedZero)]
pub struct Angle(CSSFloat);
impl ToCss for Angle {
@ -66,15 +65,6 @@ impl Angle {
}
}
impl Add for Angle {
type Output = Self;
#[inline]
fn add(self, rhs: Self) -> Self {
Angle(self.0 + rhs.0)
}
}
impl Zero for Angle {
#[inline]
fn zero() -> Self {