Skip to content

Commit d6e8504

Browse files
committed
Delete more unused code in geo-generic-alg, add more inlines to geo-traits-ext
1 parent f3a7bc9 commit d6e8504

File tree

20 files changed

+67
-611
lines changed

20 files changed

+67
-611
lines changed

rust/geo-generic-alg/src/algorithm/bounding_rect.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::utils::{partial_max, partial_min};
2-
use crate::{coord, geometry::*, CoordNum, GeometryCow};
2+
use crate::{coord, geometry::*, CoordNum};
33
use core::borrow::Borrow;
44
use geo_traits_ext::*;
55
use geo_types::private_utils::get_bounding_rect;
@@ -252,17 +252,6 @@ where
252252
}
253253
}
254254

255-
impl<T> BoundingRect<T> for GeometryCow<'_, T>
256-
where
257-
T: CoordNum,
258-
{
259-
type Output = Option<Rect<T>>;
260-
261-
crate::geometry_cow_delegate_impl! {
262-
fn bounding_rect(&self) -> Self::Output;
263-
}
264-
}
265-
266255
// Return a new rectangle that encompasses the provided rectangles
267256
fn bounding_rect_merge<T: CoordNum>(a: Rect<T>, b: Rect<T>) -> Rect<T> {
268257
Rect::new(

rust/geo-generic-alg/src/algorithm/coordinate_position.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::geometry::*;
55
use crate::intersects::{point_in_rect, value_in_between};
66
use crate::kernels::*;
77
use crate::{BoundingRect, HasDimensions, Intersects};
8-
use crate::{GeoNum, GeometryCow};
8+
use crate::GeoNum;
99
use geo_traits_ext::*;
1010

1111
/// The position of a `Coord` relative to a `Geometry`
@@ -498,18 +498,6 @@ where
498498
}
499499
}
500500

501-
impl<T: GeoNum> CoordinatePosition for GeometryCow<'_, T> {
502-
type Scalar = T;
503-
504-
crate::geometry_cow_delegate_impl! {
505-
fn calculate_coordinate_position(
506-
&self,
507-
coord: &Coord<T>,
508-
is_inside: &mut bool,
509-
boundary_count: &mut usize) -> ();
510-
}
511-
}
512-
513501
/// Calculate the position of a `Coord` relative to a
514502
/// closed `LineString`.
515503
pub fn coord_pos_relative_to_ring<T, LS>(coord: Coord<T>, linestring: &LS) -> CoordPos

rust/geo-generic-alg/src/algorithm/dimensions.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use core::borrow::Borrow;
22
use geo_traits_ext::*;
33

44
use crate::Orientation::Collinear;
5-
use crate::{CoordNum, GeoNum, GeometryCow};
5+
use crate::{CoordNum, GeoNum};
66

77
/// Geometries can have 0, 1, or two dimensions. Or, in the case of an [`empty`](#is_empty)
88
/// geometry, a special `Empty` dimensionality.
@@ -132,14 +132,6 @@ pub trait HasDimensions {
132132
fn boundary_dimensions(&self) -> Dimensions;
133133
}
134134

135-
impl<C: GeoNum> HasDimensions for GeometryCow<'_, C> {
136-
crate::geometry_cow_delegate_impl! {
137-
fn is_empty(&self) -> bool;
138-
fn dimensions(&self) -> Dimensions;
139-
fn boundary_dimensions(&self) -> Dimensions;
140-
}
141-
}
142-
143135
impl<G> HasDimensions for G
144136
where
145137
G: GeoTraitExtWithTypeTag + HasDimensionsTrait<G::Tag>,

rust/geo-generic-alg/src/algorithm/kernels/mod.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use num_traits::Zero;
2-
use std::cmp::Ordering;
32

43
use crate::{coord, Coord, CoordNum};
54

@@ -10,18 +9,6 @@ pub enum Orientation {
109
Collinear,
1110
}
1211

13-
impl Orientation {
14-
/// Helper to convert orientation-2d into an ordering.
15-
#[inline]
16-
pub(crate) fn as_ordering(&self) -> Ordering {
17-
match self {
18-
Orientation::CounterClockwise => Ordering::Less,
19-
Orientation::Clockwise => Ordering::Greater,
20-
Orientation::Collinear => Ordering::Equal,
21-
}
22-
}
23-
}
24-
2512
/// Kernel trait to provide predicates to operate on
2613
/// different scalar types.
2714
pub trait Kernel<T: CoordNum> {

rust/geo-generic-alg/src/algorithm/line_measures/length.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use super::Distance;
2-
use crate::{CoordFloat, Line, LineString, MultiLineString, Point};
2+
use crate::{CoordFloat, Point};
33
use geo_traits::{CoordTrait, PolygonTrait};
44
use geo_traits_ext::*;
55
use std::borrow::Borrow;
@@ -359,6 +359,8 @@ mod tests {
359359

360360
// Tests for LengthMeasurableExt - adapted from euclidean_length.rs
361361
mod length_measurable_ext_tests {
362+
use geo::LineString;
363+
362364
use super::*;
363365
use crate::{
364366
coord, line_string, polygon, Geometry, GeometryCollection, Line, MultiLineString,

rust/geo-generic-alg/src/geometry_cow.rs

Lines changed: 0 additions & 185 deletions
This file was deleted.

0 commit comments

Comments
 (0)