Skip to content

Commit

Permalink
Fix new clippy lints (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebarron authored Aug 25, 2023
1 parent 7be87a0 commit 8000a3a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/algorithm/geo/euclidean_distance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl EuclideanDistance<PointArray> for PointArray {
let mut output_array = MutablePrimitiveArray::<f64>::with_capacity(self.len());

self.iter_geo()
.zip(other.into_iter())
.zip(other)
.for_each(|(first, second)| match (first, second) {
(Some(first), Some(second)) => {
output_array.push(Some(first.euclidean_distance(&second.to_geo())))
Expand Down
2 changes: 1 addition & 1 deletion src/algorithm/geo/line_interpolate_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl<O: Offset> LineInterpolatePoint<PrimitiveArray<f64>> for LineStringArray<O>
let mut output_array = MutablePointArray::with_capacity(self.len());

self.iter_geo()
.zip(p.into_iter())
.zip(p)
.for_each(|(first, second)| match (first, second) {
(Some(first), Some(fraction)) => {
output_array.push_point(first.line_interpolate_point(*fraction).as_ref())
Expand Down
10 changes: 5 additions & 5 deletions src/algorithm/geo/scale.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl Scale for PointArray {
fn scale(&self, scale_factor: BroadcastablePrimitive<f64>) -> Self {
let output_geoms: Vec<Option<geo::Point>> = self
.iter_geo()
.zip(scale_factor.into_iter())
.zip(&scale_factor)
.map(|(maybe_g, scale_factor)| maybe_g.map(|geom| geom.scale(scale_factor)))
.collect();

Expand All @@ -117,8 +117,8 @@ impl Scale for PointArray {
) -> Self {
let output_geoms: Vec<Option<geo::Point>> = self
.iter_geo()
.zip(x_factor.into_iter())
.zip(y_factor.into_iter())
.zip(&x_factor)
.zip(&y_factor)
.map(|((maybe_g, x_factor), y_factor)| {
maybe_g.map(|geom| geom.scale_xy(x_factor, y_factor))
})
Expand All @@ -135,8 +135,8 @@ impl Scale for PointArray {
) -> Self {
let output_geoms: Vec<Option<geo::Point>> = self
.iter_geo()
.zip(x_factor.into_iter())
.zip(y_factor.into_iter())
.zip(&x_factor)
.zip(&y_factor)
.map(|((maybe_g, x_factor), y_factor)| {
maybe_g.map(|geom| geom.scale_around_point(x_factor, y_factor, origin))
})
Expand Down
10 changes: 5 additions & 5 deletions src/algorithm/geo/skew.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl Skew for PointArray {
fn skew(&self, scale_factor: BroadcastablePrimitive<f64>) -> Self {
let output_geoms: Vec<Option<geo::Point>> = self
.iter_geo()
.zip(scale_factor.into_iter())
.zip(&scale_factor)
.map(|(maybe_g, scale_factor)| maybe_g.map(|geom| geom.skew(scale_factor)))
.collect();

Expand All @@ -152,8 +152,8 @@ impl Skew for PointArray {
) -> Self {
let output_geoms: Vec<Option<geo::Point>> = self
.iter_geo()
.zip(x_factor.into_iter())
.zip(y_factor.into_iter())
.zip(&x_factor)
.zip(&y_factor)
.map(|((maybe_g, x_factor), y_factor)| {
maybe_g.map(|geom| geom.skew_xy(x_factor, y_factor))
})
Expand All @@ -170,8 +170,8 @@ impl Skew for PointArray {
) -> Self {
let output_geoms: Vec<Option<geo::Point>> = self
.iter_geo()
.zip(x_factor.into_iter())
.zip(y_factor.into_iter())
.zip(&x_factor)
.zip(&y_factor)
.map(|((maybe_g, x_factor), y_factor)| {
maybe_g.map(|geom| geom.skew_around_point(x_factor, y_factor, origin))
})
Expand Down
4 changes: 2 additions & 2 deletions src/algorithm/geo/translate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ impl Translate for PointArray {
) -> Self {
let output_geoms: Vec<Option<geo::Point>> = self
.iter_geo()
.zip(x_offset.into_iter())
.zip(y_offset.into_iter())
.zip(&x_offset)
.zip(&y_offset)
.map(|((maybe_g, x_offset), y_offset)| {
maybe_g.map(|geom| geom.translate(x_offset, y_offset))
})
Expand Down
2 changes: 1 addition & 1 deletion src/array/coord/combined/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl<'a> GeometryArrayTrait<'a> for CoordBuffer {
(CoordBuffer::Separated(cb), CoordType::Interleaved) => {
let mut new_buffer = MutableInterleavedCoordBuffer::with_capacity(cb.len());
cb.x.into_iter()
.zip(cb.y.into_iter())
.zip(cb.y)
.for_each(|(x, y)| new_buffer.push_xy(x, y));
CoordBuffer::Interleaved(new_buffer.into())
}
Expand Down

0 comments on commit 8000a3a

Please sign in to comment.