Remove #[compute(clone)]

This commit is contained in:
Anthony Ramine 2018-03-09 15:45:34 +01:00
parent 92068ca540
commit 2efd06c12d
6 changed files with 7 additions and 27 deletions

View file

@ -293,8 +293,7 @@ impl<'a, 'cx, 'cx_a: 'cx, S: ToComputedValue + 'a> Iterator for ComputedVecIter<
///
/// This trait is derivable with `#[derive(ToComputedValue)]`. The derived
/// implementation just calls `ToComputedValue::to_computed_value` on each field
/// of the passed value, or `Clone::clone` if the field is annotated with
/// `#[compute(clone)]`. The deriving code assumes that if the type isn't
/// of the passed value. The deriving code assumes that if the type isn't
/// generic, then the trait can be implemented as simple `Clone::clone` calls,
/// this means that a manual implementation with `ComputedValue = Self` is bogus
/// if it returns anything else than a clone.

View file

@ -11,7 +11,7 @@ use values::{CSSFloat, serialize_percentage};
/// A computed percentage.
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, Default, MallocSizeOf)]
#[derive(PartialEq, PartialOrd, ToAnimatedZero)]
#[derive(PartialEq, PartialOrd, ToAnimatedZero, ToComputedValue)]
pub struct Percentage(pub CSSFloat);
impl Percentage {