Skip to content

Commit

Permalink
Fixed dev-dependency issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfrances107 committed Dec 24, 2020
1 parent e875d03 commit 89eaeb1
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 19 deletions.
6 changes: 3 additions & 3 deletions geo-types/src/coordinate.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{CoordinateType, Point};

#[cfg(any(test, feature = "relative_eq"))]
#[cfg(any(feature = "relative_eq", test))]
use approx::{AbsDiffEq, RelativeEq};

#[cfg(test)]
Expand Down Expand Up @@ -243,7 +243,7 @@ impl<T: CoordinateType> Zero for Coordinate<T> {
}
}

#[cfg(any(test, feature = "relative_eq"))]
#[cfg(feature = "relative_eq")]
impl<T: CoordinateType + AbsDiffEq> AbsDiffEq for Coordinate<T>
where
T::Epsilon: Copy,
Expand All @@ -261,7 +261,7 @@ where
}
}

#[cfg(any(test, feature = "relative_eq"))]
#[cfg(feature = "relative_eq")]
impl<T: CoordinateType + RelativeEq> RelativeEq for Coordinate<T>
where
T::Epsilon: Copy,
Expand Down
4 changes: 2 additions & 2 deletions geo-types/src/line.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{Coordinate, CoordinateType, Point};
#[cfg(any(feature = "relative_eq", test))]
#[cfg(feature = "relative_eq")]
use approx::AbsDiffEq;
#[cfg(any(feature = "relative_eq", test))]
#[cfg(feature = "relative_eq")]
use approx::RelativeEq;

/// A line segment made up of exactly two
Expand Down
2 changes: 1 addition & 1 deletion geo-types/src/line_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ where
}
}

#[cfg(all(test, feature = "relative_eq"))]
#[cfg(test)]
mod test {
use super::*;

Expand Down
2 changes: 1 addition & 1 deletion geo-types/src/multi_point.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{CoordinateType, Point};
#[cfg(any(feature = "relative_eq"))]
#[cfg(feature = "relative_eq")]
use approx::AbsDiffEq;
#[cfg(feature = "relative_eq")]
use approx::RelativeEq;
Expand Down
10 changes: 5 additions & 5 deletions geo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ geographiclib-rs = { version = "0.2" }

proj = { version = "0.20.3", optional = true }

geo-types = { version = "0.6.2", path = "../geo-types", features = ["relative_eq", "rstar"] }
approx= { version = "0.4.0", optional = true }
geo-types = { version = "0.6.2", optional = true, path = "../geo-types", features = ["rstar"] }

robust = { version = "0.2.2" }

[features]
default = []
default = ["geo-types"]
use-proj = ["proj"]
proj-network = ["use-proj", "proj/network"]
use-serde = ["serde", "geo-types/serde"]
relative_eq = ["approx"]

[dev-dependencies]
approx = "0.4.0"
criterion = { version = "0.3" }
rand = "0.7.3"
geo-types = { version = "0.6.2", path = "../geo-types", features = ["relative_eq", "rstar"] }
rand = "0.8.0"

[[bench]]
name = "area"
Expand Down
12 changes: 5 additions & 7 deletions geo/src/algorithm/rotate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ where
mod test {
use super::*;
use crate::{line_string, point, polygon, Coordinate, Point};
use approx::assert_relative_eq;

#[test]
fn test_rotate_around_point() {
Expand Down Expand Up @@ -334,16 +335,13 @@ mod test {
#[test]
fn test_rotate_line() {
let line0 = Line::from([(0., 0.), (0., 2.)]);
let line1 = Line::from([(1., 0.9999999999999999), (-1., 1.)]);
assert_eq!(line0.rotate(90.), line1);
let line1 = Line::from([(1., 1.), (-1., 1.)]);
assert_relative_eq!(line0.rotate(90.0), line1);
}
#[test]
fn test_rotate_line_around_point() {
let line0 = Line::new(Point::new(0., 0.), Point::new(0., 2.));
let line1 = Line::new(
Point::new(0., 0.),
Point::new(-2., 0.00000000000000012246467991473532),
);
assert_eq!(line0.rotate_around_point(90., Point::new(0., 0.)), line1);
let line1 = Line::new(Point::new(0., 0.), Point::new(-2., 0.));
assert_relative_eq!(line0.rotate_around_point(90., Point::new(0., 0.)), line1);
}
}

0 comments on commit 89eaeb1

Please sign in to comment.