From 3991e7d344a129283709b49d24489547f140e3f2 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Wed, 2 Aug 2017 09:27:44 +1000 Subject: [PATCH] Have CoordDataValue derive Debug and PartialEq. --- .../style/gecko_bindings/sugar/ns_style_coord.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/components/style/gecko_bindings/sugar/ns_style_coord.rs b/components/style/gecko_bindings/sugar/ns_style_coord.rs index be6a2a6f80b..001ab16b6c2 100644 --- a/components/style/gecko_bindings/sugar/ns_style_coord.rs +++ b/components/style/gecko_bindings/sugar/ns_style_coord.rs @@ -54,6 +54,14 @@ impl nsStyleCoord_CalcValue { } } +impl PartialEq for nsStyleCoord_CalcValue { + fn eq(&self, other: &Self) -> bool { + self.mLength == other.mLength && + self.mPercent == other.mPercent && + self.mHasPercent == other.mHasPercent + } +} + impl nsStyleSides { /// Immutably get the `nsStyleCoord`-like object representing the side at /// index `index`. @@ -192,11 +200,11 @@ impl<'a> CoordDataMut for CornersDataMut<'a> { } } -#[derive(Copy, Clone)] /// Enum representing the tagged union that is CoordData. /// /// In release mode this should never actually exist in the code, and will be /// optimized out by threading matches and inlining. +#[derive(Copy, Clone, Debug, PartialEq)] pub enum CoordDataValue { /// eStyleUnit_Null Null,