mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Auto merge of #20481 - emilio:debug-wat, r=nox
style: Derive a debug impl instead of implementing by hand. <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20481) <!-- Reviewable:end -->
This commit is contained in:
commit
39018f9339
1 changed files with 1 additions and 13 deletions
|
@ -120,7 +120,7 @@ pub enum GradientItem<Color, LengthOrPercentage> {
|
||||||
|
|
||||||
/// A color stop.
|
/// A color stop.
|
||||||
/// <https://drafts.csswg.org/css-images/#typedef-color-stop-list>
|
/// <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> {
|
pub struct ColorStop<Color, LengthOrPercentage> {
|
||||||
/// The color of this stop.
|
/// The color of this stop.
|
||||||
pub color: Color,
|
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(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue