Skip to content

Commit bfb2746

Browse files
Fixed dev-dependency issue.
1 parent c21a552 commit bfb2746

6 files changed

Lines changed: 16 additions & 18 deletions

File tree

geo-types/src/coordinate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{CoordinateType, Point};
22

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

66
#[cfg(test)]
@@ -243,7 +243,7 @@ impl<T: CoordinateType> Zero for Coordinate<T> {
243243
}
244244
}
245245

246-
#[cfg(any(test, feature = "relative_eq"))]
246+
#[cfg(feature = "relative_eq")]
247247
impl<T: CoordinateType + AbsDiffEq> AbsDiffEq for Coordinate<T>
248248
where
249249
T::Epsilon: Copy,
@@ -261,7 +261,7 @@ where
261261
}
262262
}
263263

264-
#[cfg(any(test, feature = "relative_eq"))]
264+
#[cfg(feature = "relative_eq")]
265265
impl<T: CoordinateType + RelativeEq> RelativeEq for Coordinate<T>
266266
where
267267
T::Epsilon: Copy,

geo-types/src/line.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::{Coordinate, CoordinateType, Point};
2-
#[cfg(any(feature = "relative_eq", test))]
2+
#[cfg(feature = "relative_eq")]
33
use approx::AbsDiffEq;
4-
#[cfg(any(feature = "relative_eq", test))]
4+
#[cfg(feature = "relative_eq")]
55
use approx::RelativeEq;
66

77
/// A line segment made up of exactly two

geo-types/src/line_string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ where
405405
}
406406
}
407407

408-
#[cfg(all(test, feature = "relative_eq"))]
408+
#[cfg(test)]
409409
mod test {
410410
use super::*;
411411

geo-types/src/multi_point.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::{CoordinateType, Point};
2-
#[cfg(any(feature = "relative_eq"))]
2+
#[cfg(feature = "relative_eq")]
33
use approx::AbsDiffEq;
44
#[cfg(feature = "relative_eq")]
55
use approx::RelativeEq;

geo/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ geographiclib-rs = { version = "0.2" }
2222

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

25-
geo-types = { version = "0.6.2", path = "../geo-types", features = ["relative_eq", "rstar"] }
26-
approx= { version = "0.4.0", optional = true }
25+
geo-types = { version = "0.6.2", optional = true, path = "../geo-types", features = ["rstar"] }
26+
2727
robust = { version = "0.2.2" }
2828

2929
[features]
30-
default = []
30+
default = ["geo-types"]
3131
use-proj = ["proj"]
3232
proj-network = ["use-proj", "proj/network"]
3333
use-serde = ["serde", "geo-types/serde"]
34-
relative_eq = ["approx"]
3534

3635
[dev-dependencies]
3736
approx = "0.4.0"
3837
criterion = { version = "0.3" }
38+
geo-types = { version = "0.6.2", path = "../geo-types", features = ["relative_eq", "rstar"] }
3939
rand = "0.8.0"
4040

4141
[[bench]]

geo/src/algorithm/rotate.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ where
221221
mod test {
222222
use super::*;
223223
use crate::{line_string, point, polygon, Coordinate, Point};
224+
use approx::assert_relative_eq;
224225

225226
#[test]
226227
fn test_rotate_around_point() {
@@ -334,16 +335,13 @@ mod test {
334335
#[test]
335336
fn test_rotate_line() {
336337
let line0 = Line::from([(0., 0.), (0., 2.)]);
337-
let line1 = Line::from([(1., 0.9999999999999999), (-1., 1.)]);
338-
assert_eq!(line0.rotate(90.), line1);
338+
let line1 = Line::from([(1., 1.), (-1., 1.)]);
339+
assert_relative_eq!(line0.rotate(90.0), line1);
339340
}
340341
#[test]
341342
fn test_rotate_line_around_point() {
342343
let line0 = Line::new(Point::new(0., 0.), Point::new(0., 2.));
343-
let line1 = Line::new(
344-
Point::new(0., 0.),
345-
Point::new(-2., 0.00000000000000012246467991473532),
346-
);
347-
assert_eq!(line0.rotate_around_point(90., Point::new(0., 0.)), line1);
344+
let line1 = Line::new(Point::new(0., 0.), Point::new(-2., 0.));
345+
assert_relative_eq!(line0.rotate_around_point(90., Point::new(0., 0.)), line1);
348346
}
349347
}

0 commit comments

Comments
 (0)