mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Derive the most trivial Animate impls
This commit is contained in:
parent
faaf31411a
commit
7ee124b1ed
20 changed files with 168 additions and 314 deletions
|
@ -84,20 +84,10 @@ macro_rules! define_keyword_type {
|
|||
($name: ident, $css: expr) => {
|
||||
#[allow(missing_docs)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, ComputeSquaredDistance, Copy, PartialEq, ToAnimatedZero, ToCss)]
|
||||
#[derive(Animate, Clone, ComputeSquaredDistance, Copy, PartialEq)]
|
||||
#[derive(ToAnimatedZero, ToCss)]
|
||||
pub struct $name;
|
||||
|
||||
impl $crate::values::animated::Animate for $name {
|
||||
#[inline]
|
||||
fn animate(
|
||||
&self,
|
||||
_other: &Self,
|
||||
_procedure: $crate::values::animated::Procedure,
|
||||
) -> Result<Self, ()> {
|
||||
Ok($name)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for $name {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, $css)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue