style: Derive a debug impl instead of implementing by hand.

This commit is contained in:
Emilio Cobos Álvarez 2018-03-31 00:53:47 +02:00
parent d232705106
commit ec0c4f396a
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -120,7 +120,7 @@ pub enum GradientItem<Color, LengthOrPercentage> {
/// A color stop.
/// <https://drafts.csswg.org/css-images/#typedef-color-stop-list>
#[derive(Clone, Copy, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]
pub struct ColorStop<Color, LengthOrPercentage> {
/// The color of this stop.
pub color: Color,
@ -310,15 +310,3 @@ where
}
}
}
impl<C, L> fmt::Debug for ColorStop<C, L>
where C: fmt::Debug, L: fmt::Debug,
{
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{:?}", self.color)?;
if let Some(ref pos) = self.position {
write!(f, " {:?}", pos)?;
}
Ok(())
}
}