From 07c2427f35a3dd211daeb46d09b64ceed9acc4de Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Thu, 25 Feb 2016 21:30:24 -0500 Subject: [PATCH] Implement Eq trait for Rect, Size2D, SideOffsets2D. Fixes https://github.com/servo/euclid/issues/123. --- src/rect.rs | 2 +- src/side_offsets.rs | 2 +- src/size.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rect.rs b/src/rect.rs index 9cd8942..8a87470 100644 --- a/src/rect.rs +++ b/src/rect.rs @@ -17,7 +17,7 @@ use std::cmp::PartialOrd; use std::fmt; use std::ops::{Add, Sub, Mul, Div}; -#[derive(Clone, Copy, RustcDecodable, RustcEncodable, PartialEq)] +#[derive(Clone, Copy, Eq, RustcDecodable, RustcEncodable, PartialEq)] #[cfg_attr(feature = "plugins", derive(HeapSizeOf, Deserialize, Serialize))] pub struct Rect { pub origin: Point2D, diff --git a/src/side_offsets.rs b/src/side_offsets.rs index 7a71239..0b2c599 100644 --- a/src/side_offsets.rs +++ b/src/side_offsets.rs @@ -15,7 +15,7 @@ use std::ops::Add; /// A group of side offsets, which correspond to top/left/bottom/right for borders, padding, /// and margins in CSS. -#[derive(Clone, Copy, PartialEq, Debug)] +#[derive(Clone, Copy, Eq, PartialEq, Debug)] #[cfg_attr(feature = "plugins", derive(HeapSizeOf, Deserialize, Serialize))] pub struct SideOffsets2D { pub top: T, diff --git a/src/size.rs b/src/size.rs index f2a627f..94a26c4 100644 --- a/src/size.rs +++ b/src/size.rs @@ -14,7 +14,7 @@ use num_lib::NumCast; use std::fmt; use std::ops::{Mul, Div}; -#[derive(Clone, Copy, RustcDecodable, RustcEncodable, PartialEq)] +#[derive(Clone, Copy, Eq, RustcDecodable, RustcEncodable, PartialEq)] #[cfg_attr(feature = "plugins", derive(HeapSizeOf, Deserialize, Serialize))] pub struct Size2D { pub width: T,