diff --git a/geo-types/src/coordinate.rs b/geo-types/src/coordinate.rs index 4f6ecb12e..dbc12f9c5 100644 --- a/geo-types/src/coordinate.rs +++ b/geo-types/src/coordinate.rs @@ -7,7 +7,7 @@ use crate::{CoordinateType, Point}; /// as an envelope, a precision model, and spatial reference system /// information), a `Coordinate` only contains ordinate values and accessor /// methods. -#[derive(PartialEq, Clone, Copy, Debug, Hash)] +#[derive(Eq, PartialEq, Clone, Copy, Debug, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Coordinate where @@ -17,8 +17,6 @@ where pub y: T, } -impl std::cmp::Eq for Coordinate where T: std::cmp::Eq {} - impl From<(T, T)> for Coordinate { fn from(coords: (T, T)) -> Self { Coordinate { diff --git a/geo-types/src/geometry.rs b/geo-types/src/geometry.rs index 4f4ac4abf..a69870f8f 100644 --- a/geo-types/src/geometry.rs +++ b/geo-types/src/geometry.rs @@ -23,7 +23,7 @@ use std::fmt; /// let pn = Point::try_from(pe).unwrap(); /// ``` /// -#[derive(PartialEq, Clone, Debug, Hash)] +#[derive(Eq, PartialEq, Clone, Debug, Hash)] pub enum Geometry where T: CoordinateType, diff --git a/geo-types/src/geometry_collection.rs b/geo-types/src/geometry_collection.rs index 679e7f1e2..4613725de 100644 --- a/geo-types/src/geometry_collection.rs +++ b/geo-types/src/geometry_collection.rs @@ -63,7 +63,7 @@ use std::ops::{Index, IndexMut}; /// println!("{:?}", gc[0]); /// ``` /// -#[derive(PartialEq, Clone, Debug, Hash)] +#[derive(Eq, PartialEq, Clone, Debug, Hash)] pub struct GeometryCollection(pub Vec>) where T: CoordinateType; diff --git a/geo-types/src/line.rs b/geo-types/src/line.rs index bc16ed513..0395f1b14 100644 --- a/geo-types/src/line.rs +++ b/geo-types/src/line.rs @@ -1,7 +1,7 @@ use crate::{Coordinate, CoordinateType, Point}; /// A line segment made up of exactly two [`Point`s](struct.Point.html). -#[derive(PartialEq, Clone, Copy, Debug, Hash)] +#[derive(Eq, PartialEq, Clone, Copy, Debug, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Line where diff --git a/geo-types/src/line_string.rs b/geo-types/src/line_string.rs index feb0fe0db..406fb3476 100644 --- a/geo-types/src/line_string.rs +++ b/geo-types/src/line_string.rs @@ -73,7 +73,7 @@ use std::ops::{Index, IndexMut}; /// } /// ``` -#[derive(PartialEq, Clone, Debug, Hash)] +#[derive(Eq, PartialEq, Clone, Debug, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct LineString(pub Vec>) where diff --git a/geo-types/src/multi_line_string.rs b/geo-types/src/multi_line_string.rs index a2334af15..c323cf340 100644 --- a/geo-types/src/multi_line_string.rs +++ b/geo-types/src/multi_line_string.rs @@ -6,7 +6,7 @@ use std::iter::FromIterator; /// Can be created from a `Vec` of `LineString`s, or from an Iterator which yields `LineString`s. /// /// Iterating over this objects, yields the component `LineString`s. -#[derive(PartialEq, Clone, Debug, Hash)] +#[derive(Eq, PartialEq, Clone, Debug, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct MultiLineString(pub Vec>) where diff --git a/geo-types/src/multi_point.rs b/geo-types/src/multi_point.rs index 3056b9ed2..ea54fc34d 100644 --- a/geo-types/src/multi_point.rs +++ b/geo-types/src/multi_point.rs @@ -14,7 +14,7 @@ use std::iter::FromIterator; /// println!("Point x = {}, y = {}", point.x(), point.y()); /// } /// ``` -#[derive(PartialEq, Clone, Debug, Hash)] +#[derive(Eq, PartialEq, Clone, Debug, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct MultiPoint(pub Vec>) where diff --git a/geo-types/src/multi_polygon.rs b/geo-types/src/multi_polygon.rs index caf548f0e..b0b14fad1 100644 --- a/geo-types/src/multi_polygon.rs +++ b/geo-types/src/multi_polygon.rs @@ -6,7 +6,7 @@ use std::iter::FromIterator; /// Can be created from a `Vec` of `Polygon`s, or `collect`ed from an Iterator which yields `Polygon`s. /// /// Iterating over this object yields the component Polygons. -#[derive(PartialEq, Clone, Debug, Hash)] +#[derive(Eq, PartialEq, Clone, Debug, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct MultiPolygon(pub Vec>) where diff --git a/geo-types/src/point.rs b/geo-types/src/point.rs index d4c1ce9fd..3fc3dae22 100644 --- a/geo-types/src/point.rs +++ b/geo-types/src/point.rs @@ -17,7 +17,7 @@ use std::ops::Sub; /// let c = Coordinate { x: 10., y: 20. }; /// let p2: Point = c.into(); /// ``` -#[derive(PartialEq, Clone, Copy, Debug, Hash)] +#[derive(Eq, PartialEq, Clone, Copy, Debug, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Point(pub Coordinate) where diff --git a/geo-types/src/polygon.rs b/geo-types/src/polygon.rs index 9b9403814..cdb8a0707 100644 --- a/geo-types/src/polygon.rs +++ b/geo-types/src/polygon.rs @@ -31,7 +31,7 @@ use num_traits::{Float, Signed}; /// the first `Coordinate`. /// /// [`LineString`]: line_string/struct.LineString.html -#[derive(PartialEq, Clone, Debug, Hash)] +#[derive(Eq, PartialEq, Clone, Debug, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Polygon where diff --git a/geo-types/src/rect.rs b/geo-types/src/rect.rs index ea76295ef..2fa8a0f6a 100644 --- a/geo-types/src/rect.rs +++ b/geo-types/src/rect.rs @@ -1,7 +1,7 @@ use crate::{polygon, Coordinate, CoordinateType, Polygon}; /// A bounded 2D quadrilateral whose area is defined by minimum and maximum `Coordinates`. -#[derive(PartialEq, Clone, Copy, Debug, Hash)] +#[derive(Eq, PartialEq, Clone, Copy, Debug, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Rect where diff --git a/geo-types/src/triangle.rs b/geo-types/src/triangle.rs index e2efaa9e5..2304e9c89 100644 --- a/geo-types/src/triangle.rs +++ b/geo-types/src/triangle.rs @@ -1,7 +1,7 @@ use crate::{polygon, Coordinate, CoordinateType, Line, Polygon}; /// A bounded 2D area whose three vertices are defined by `Coordinate`s. -#[derive(Copy, Clone, Debug, Hash, PartialEq)] +#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Triangle(pub Coordinate, pub Coordinate, pub Coordinate);