From 7f1c00e23302669e04d519479a71e7f53d2b6d5e Mon Sep 17 00:00:00 2001 From: Kyle Barron Date: Fri, 13 Dec 2024 12:45:34 -0500 Subject: [PATCH] Fix new clippy lints --- src/conversion/from_geo_types.rs | 22 +++++++++++----------- src/feature_iterator.rs | 4 ++-- src/geojson.rs | 4 ++-- src/lib.rs | 2 +- src/ser.rs | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/conversion/from_geo_types.rs b/src/conversion/from_geo_types.rs index 8e96d7c..df1cc5b 100644 --- a/src/conversion/from_geo_types.rs +++ b/src/conversion/from_geo_types.rs @@ -6,7 +6,7 @@ use crate::{LineStringType, PointType, PolygonType}; use std::convert::From; #[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))] -impl<'a, T> From<&'a geo_types::Point> for geometry::Value +impl From<&geo_types::Point> for geometry::Value where T: CoordFloat, { @@ -18,7 +18,7 @@ where } #[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))] -impl<'a, T> From<&'a geo_types::MultiPoint> for geometry::Value +impl From<&geo_types::MultiPoint> for geometry::Value where T: CoordFloat, { @@ -34,7 +34,7 @@ where } #[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))] -impl<'a, T> From<&'a geo_types::LineString> for geometry::Value +impl From<&geo_types::LineString> for geometry::Value where T: CoordFloat, { @@ -46,7 +46,7 @@ where } #[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))] -impl<'a, T> From<&'a geo_types::Line> for geometry::Value +impl From<&geo_types::Line> for geometry::Value where T: CoordFloat, { @@ -58,7 +58,7 @@ where } #[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))] -impl<'a, T> From<&'a geo_types::Triangle> for geometry::Value +impl From<&geo_types::Triangle> for geometry::Value where T: CoordFloat, { @@ -70,7 +70,7 @@ where } #[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))] -impl<'a, T> From<&'a geo_types::Rect> for geometry::Value +impl From<&geo_types::Rect> for geometry::Value where T: CoordFloat, { @@ -82,7 +82,7 @@ where } #[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))] -impl<'a, T> From<&'a geo_types::MultiLineString> for geometry::Value +impl From<&geo_types::MultiLineString> for geometry::Value where T: CoordFloat, { @@ -94,7 +94,7 @@ where } #[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))] -impl<'a, T> From<&'a geo_types::Polygon> for geometry::Value +impl From<&geo_types::Polygon> for geometry::Value where T: CoordFloat, { @@ -106,7 +106,7 @@ where } #[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))] -impl<'a, T> From<&'a geo_types::MultiPolygon> for geometry::Value +impl From<&geo_types::MultiPolygon> for geometry::Value where T: CoordFloat, { @@ -118,7 +118,7 @@ where } #[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))] -impl<'a, T> From<&'a geo_types::GeometryCollection> for geometry::Value +impl From<&geo_types::GeometryCollection> for geometry::Value where T: CoordFloat, { @@ -134,7 +134,7 @@ where } #[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))] -impl<'a, T> From<&'a geo_types::GeometryCollection> for FeatureCollection +impl From<&geo_types::GeometryCollection> for FeatureCollection where T: CoordFloat, { diff --git a/src/feature_iterator.rs b/src/feature_iterator.rs index 27729ee..78a7ba0 100644 --- a/src/feature_iterator.rs +++ b/src/feature_iterator.rs @@ -48,7 +48,7 @@ enum State { AfterFeatures, } -impl<'de, R, D> FeatureIterator<'de, R, D> { +impl FeatureIterator<'_, R, D> { pub fn new(reader: R) -> Self { FeatureIterator { reader, @@ -59,7 +59,7 @@ impl<'de, R, D> FeatureIterator<'de, R, D> { } } -impl<'de, R, D> FeatureIterator<'de, R, D> +impl FeatureIterator<'_, R, D> where R: io::Read, { diff --git a/src/geojson.rs b/src/geojson.rs index 7213a29..9ea4422 100644 --- a/src/geojson.rs +++ b/src/geojson.rs @@ -237,8 +237,8 @@ impl GeoJson { /// Convenience wrapper for [serde_json::to_string_pretty()] pub fn to_string_pretty(self) -> Result { ::serde_json::to_string_pretty(&self) - .map_err(|err| Error::MalformedJson(err)) - .and_then(|s| Ok(s.to_string())) + .map_err(Error::MalformedJson) + .map(|s| s.to_string()) } } diff --git a/src/lib.rs b/src/lib.rs index f7da524..6a0d77f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -333,7 +333,7 @@ //! //! ### Caveats //! - Round-tripping with intermediate processing using the `geo` types may not produce identical output, -//! as e.g. outer `Polygon` rings are automatically closed. +//! as e.g. outer `Polygon` rings are automatically closed. //! - `geojson` attempts to output valid geometries. In particular, it may re-orient `Polygon` rings when serialising. //! //! The [`geojson_example`](https://github.com/urschrei/geojson_example) and diff --git a/src/ser.rs b/src/ser.rs index 6a52638..78e5712 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -344,7 +344,7 @@ where } } -impl<'a, T> serde::Serialize for Features<'a, T> +impl serde::Serialize for Features<'_, T> where T: Serialize, {