From 83a4d843639181234c265feb3d8e17e8aba9ba95 Mon Sep 17 00:00:00 2001 From: Kyle Barron Date: Sun, 15 Dec 2024 23:30:01 -0500 Subject: [PATCH] cleanup --- js/Cargo.lock | 2 +- rust/geoarrow/src/algorithm/geo/euclidean_distance.rs | 2 +- rust/geoarrow/src/algorithm/geo/within.rs | 2 +- rust/geoarrow/src/scalar/coord/interleaved.rs | 4 ++-- rust/geoarrow/src/scalar/geometrycollection.rs | 2 +- rust/geoarrow/src/scalar/linestring.rs | 4 ++-- rust/geoarrow/src/scalar/multilinestring.rs | 4 ++-- rust/geoarrow/src/scalar/multipoint.rs | 4 ++-- rust/geoarrow/src/scalar/multipolygon.rs | 4 ++-- rust/geoarrow/src/scalar/point.rs | 8 ++++---- rust/geoarrow/src/scalar/polygon.rs | 4 ++-- rust/geoarrow/src/scalar/rect.rs | 2 +- 12 files changed, 21 insertions(+), 21 deletions(-) diff --git a/js/Cargo.lock b/js/Cargo.lock index 8695cdfa..85b40204 100644 --- a/js/Cargo.lock +++ b/js/Cargo.lock @@ -1093,7 +1093,7 @@ dependencies = [ [[package]] name = "geoarrow" -version = "0.4.0-beta.1" +version = "0.4.0-beta.2" dependencies = [ "arrow", "arrow-array", diff --git a/rust/geoarrow/src/algorithm/geo/euclidean_distance.rs b/rust/geoarrow/src/algorithm/geo/euclidean_distance.rs index 6b8951fa..b7204037 100644 --- a/rust/geoarrow/src/algorithm/geo/euclidean_distance.rs +++ b/rust/geoarrow/src/algorithm/geo/euclidean_distance.rs @@ -186,7 +186,7 @@ iter_geo_impl!(MultiPolygonArray, PointArray); // └─────────────────────────────────┘ // Note: this implementation is outside the macro because it is not generic over O -impl<'a> EuclideanDistance for PointArray { +impl EuclideanDistance for PointArray { /// Minimum distance between two Points fn euclidean_distance(&self, other: &Point) -> Float64Array { let mut output_array = Float64Builder::with_capacity(self.len()); diff --git a/rust/geoarrow/src/algorithm/geo/within.rs b/rust/geoarrow/src/algorithm/geo/within.rs index 224121b7..f11fefb0 100644 --- a/rust/geoarrow/src/algorithm/geo/within.rs +++ b/rust/geoarrow/src/algorithm/geo/within.rs @@ -142,7 +142,7 @@ iter_geo_impl!(MultiPolygonArray, MultiPolygonArray); // └──────────────────────────────────────────┘ // Note: this implementation is outside the macro because it is not generic over O -impl<'a> Within for PointArray { +impl Within for PointArray { fn is_within(&self, rhs: &Point) -> BooleanArray { let mut output_array = BooleanBuilder::with_capacity(self.len()); diff --git a/rust/geoarrow/src/scalar/coord/interleaved.rs b/rust/geoarrow/src/scalar/coord/interleaved.rs index ef6f8931..8d0228d5 100644 --- a/rust/geoarrow/src/scalar/coord/interleaved.rs +++ b/rust/geoarrow/src/scalar/coord/interleaved.rs @@ -97,7 +97,7 @@ impl CoordTrait for InterleavedCoord { } fn x(&self) -> Self::T { - *self.coords.get(0).unwrap() + *self.coords.first().unwrap() } fn y(&self) -> Self::T { @@ -118,7 +118,7 @@ impl CoordTrait for &InterleavedCoord { } fn x(&self) -> Self::T { - *self.coords.get(0).unwrap() + *self.coords.first().unwrap() } fn y(&self) -> Self::T { diff --git a/rust/geoarrow/src/scalar/geometrycollection.rs b/rust/geoarrow/src/scalar/geometrycollection.rs index f981569b..b9b83ee9 100644 --- a/rust/geoarrow/src/scalar/geometrycollection.rs +++ b/rust/geoarrow/src/scalar/geometrycollection.rs @@ -70,7 +70,7 @@ impl GeometryCollectionTrait for GeometryCollection { } } -impl<'a> GeometryCollectionTrait for &'a GeometryCollection { +impl GeometryCollectionTrait for &GeometryCollection { type T = f64; type GeometryType<'b> = Geometry diff --git a/rust/geoarrow/src/scalar/linestring.rs b/rust/geoarrow/src/scalar/linestring.rs index d0f91bad..400c99ff 100644 --- a/rust/geoarrow/src/scalar/linestring.rs +++ b/rust/geoarrow/src/scalar/linestring.rs @@ -51,7 +51,7 @@ impl NativeScalar for LineString { } } -impl<'a> LineStringTrait for LineString { +impl LineStringTrait for LineString { type T = f64; type CoordType<'b> = Coord @@ -72,7 +72,7 @@ impl<'a> LineStringTrait for LineString { } } -impl<'a> LineStringTrait for &'a LineString { +impl LineStringTrait for &LineString { type T = f64; type CoordType<'b> = Coord diff --git a/rust/geoarrow/src/scalar/multilinestring.rs b/rust/geoarrow/src/scalar/multilinestring.rs index d5865995..86bd3c3d 100644 --- a/rust/geoarrow/src/scalar/multilinestring.rs +++ b/rust/geoarrow/src/scalar/multilinestring.rs @@ -49,7 +49,7 @@ impl NativeScalar for MultiLineString { } } -impl<'a> MultiLineStringTrait for MultiLineString { +impl MultiLineStringTrait for MultiLineString { type T = f64; type LineStringType<'b> = LineString @@ -76,7 +76,7 @@ impl<'a> MultiLineStringTrait for MultiLineString { } } -impl<'a> MultiLineStringTrait for &'a MultiLineString { +impl MultiLineStringTrait for &MultiLineString { type T = f64; type LineStringType<'b> = LineString diff --git a/rust/geoarrow/src/scalar/multipoint.rs b/rust/geoarrow/src/scalar/multipoint.rs index 86b0af02..840564bf 100644 --- a/rust/geoarrow/src/scalar/multipoint.rs +++ b/rust/geoarrow/src/scalar/multipoint.rs @@ -49,7 +49,7 @@ impl NativeScalar for MultiPoint { } } -impl<'a> MultiPointTrait for MultiPoint { +impl MultiPointTrait for MultiPoint { type T = f64; type PointType<'b> = Point @@ -71,7 +71,7 @@ impl<'a> MultiPointTrait for MultiPoint { } } -impl<'a> MultiPointTrait for &'a MultiPoint { +impl MultiPointTrait for &MultiPoint { type T = f64; type PointType<'b> = Point diff --git a/rust/geoarrow/src/scalar/multipolygon.rs b/rust/geoarrow/src/scalar/multipolygon.rs index 78071866..d3d1d0b2 100644 --- a/rust/geoarrow/src/scalar/multipolygon.rs +++ b/rust/geoarrow/src/scalar/multipolygon.rs @@ -49,7 +49,7 @@ impl NativeScalar for MultiPolygon { } } -impl<'a> MultiPolygonTrait for MultiPolygon { +impl MultiPolygonTrait for MultiPolygon { type T = f64; type PolygonType<'b> = Polygon @@ -77,7 +77,7 @@ impl<'a> MultiPolygonTrait for MultiPolygon { } } -impl<'a> MultiPolygonTrait for &'a MultiPolygon { +impl MultiPolygonTrait for &MultiPolygon { type T = f64; type PolygonType<'b> = Polygon diff --git a/rust/geoarrow/src/scalar/point.rs b/rust/geoarrow/src/scalar/point.rs index 30bae12f..dc22f0fc 100644 --- a/rust/geoarrow/src/scalar/point.rs +++ b/rust/geoarrow/src/scalar/point.rs @@ -2,7 +2,7 @@ use crate::algorithm::native::bounding_rect::bounding_rect_point; use crate::algorithm::native::eq::point_eq; use crate::array::PointArray; use crate::scalar::Coord; -use crate::trait_::{ArrayAccessor, NativeScalar}; +use crate::trait_::NativeScalar; use crate::{ArrayBase, NativeArray}; use geo_traits::to_geo::ToGeoPoint; use geo_traits::PointTrait; @@ -55,7 +55,7 @@ impl PointTrait for Point { } fn coord(&self) -> Option> { - let coord = self.0.value(0); + let coord = self.0.coords.value(0); if coord.is_nan() { None } else { @@ -64,7 +64,7 @@ impl PointTrait for Point { } } -impl<'a> PointTrait for &Point { +impl PointTrait for &Point { type T = f64; type CoordType<'b> = Coord @@ -76,7 +76,7 @@ impl<'a> PointTrait for &Point { } fn coord(&self) -> Option> { - let coord = self.0.value(0); + let coord = self.0.coords.value(0); if coord.is_nan() { None } else { diff --git a/rust/geoarrow/src/scalar/polygon.rs b/rust/geoarrow/src/scalar/polygon.rs index 43a8efa7..3daa29c1 100644 --- a/rust/geoarrow/src/scalar/polygon.rs +++ b/rust/geoarrow/src/scalar/polygon.rs @@ -65,7 +65,7 @@ impl NativeScalar for Polygon { } } -impl<'a> PolygonTrait for Polygon { +impl PolygonTrait for Polygon { type T = f64; type RingType<'b> = LineString @@ -107,7 +107,7 @@ impl<'a> PolygonTrait for Polygon { } } -impl<'a> PolygonTrait for &'a Polygon { +impl PolygonTrait for &Polygon { type T = f64; type RingType<'b> = LineString diff --git a/rust/geoarrow/src/scalar/rect.rs b/rust/geoarrow/src/scalar/rect.rs index fc2f5185..45d4977b 100644 --- a/rust/geoarrow/src/scalar/rect.rs +++ b/rust/geoarrow/src/scalar/rect.rs @@ -44,7 +44,7 @@ impl NativeScalar for Rect { } // TODO: support 3d rects -impl<'a> RectTrait for Rect { +impl RectTrait for Rect { type T = f64; type CoordType<'b> = SeparatedCoord