Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix new clippy lints #249

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/conversion/from_geo_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>> for geometry::Value
impl<T> From<&geo_types::Point<T>> for geometry::Value
where
T: CoordFloat,
{
Expand All @@ -18,7 +18,7 @@ where
}

#[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))]
impl<'a, T> From<&'a geo_types::MultiPoint<T>> for geometry::Value
impl<T> From<&geo_types::MultiPoint<T>> for geometry::Value
where
T: CoordFloat,
{
Expand All @@ -34,7 +34,7 @@ where
}

#[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))]
impl<'a, T> From<&'a geo_types::LineString<T>> for geometry::Value
impl<T> From<&geo_types::LineString<T>> for geometry::Value
where
T: CoordFloat,
{
Expand All @@ -46,7 +46,7 @@ where
}

#[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))]
impl<'a, T> From<&'a geo_types::Line<T>> for geometry::Value
impl<T> From<&geo_types::Line<T>> for geometry::Value
where
T: CoordFloat,
{
Expand All @@ -58,7 +58,7 @@ where
}

#[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))]
impl<'a, T> From<&'a geo_types::Triangle<T>> for geometry::Value
impl<T> From<&geo_types::Triangle<T>> for geometry::Value
where
T: CoordFloat,
{
Expand All @@ -70,7 +70,7 @@ where
}

#[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))]
impl<'a, T> From<&'a geo_types::Rect<T>> for geometry::Value
impl<T> From<&geo_types::Rect<T>> for geometry::Value
where
T: CoordFloat,
{
Expand All @@ -82,7 +82,7 @@ where
}

#[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))]
impl<'a, T> From<&'a geo_types::MultiLineString<T>> for geometry::Value
impl<T> From<&geo_types::MultiLineString<T>> for geometry::Value
where
T: CoordFloat,
{
Expand All @@ -94,7 +94,7 @@ where
}

#[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))]
impl<'a, T> From<&'a geo_types::Polygon<T>> for geometry::Value
impl<T> From<&geo_types::Polygon<T>> for geometry::Value
where
T: CoordFloat,
{
Expand All @@ -106,7 +106,7 @@ where
}

#[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))]
impl<'a, T> From<&'a geo_types::MultiPolygon<T>> for geometry::Value
impl<T> From<&geo_types::MultiPolygon<T>> for geometry::Value
where
T: CoordFloat,
{
Expand All @@ -118,7 +118,7 @@ where
}

#[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))]
impl<'a, T> From<&'a geo_types::GeometryCollection<T>> for geometry::Value
impl<T> From<&geo_types::GeometryCollection<T>> for geometry::Value
where
T: CoordFloat,
{
Expand All @@ -134,7 +134,7 @@ where
}

#[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))]
impl<'a, T> From<&'a geo_types::GeometryCollection<T>> for FeatureCollection
impl<T> From<&geo_types::GeometryCollection<T>> for FeatureCollection
where
T: CoordFloat,
{
Expand Down
4 changes: 2 additions & 2 deletions src/feature_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ enum State {
AfterFeatures,
}

impl<'de, R, D> FeatureIterator<'de, R, D> {
impl<R, D> FeatureIterator<'_, R, D> {
pub fn new(reader: R) -> Self {
FeatureIterator {
reader,
Expand All @@ -59,7 +59,7 @@ impl<'de, R, D> FeatureIterator<'de, R, D> {
}
}

impl<'de, R, D> FeatureIterator<'de, R, D>
impl<R, D> FeatureIterator<'_, R, D>
where
R: io::Read,
{
Expand Down
4 changes: 2 additions & 2 deletions src/geojson.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ impl GeoJson {
/// Convenience wrapper for [serde_json::to_string_pretty()]
pub fn to_string_pretty(self) -> Result<String> {
::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())
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ where
}
}

impl<'a, T> serde::Serialize for Features<'a, T>
impl<T> serde::Serialize for Features<'_, T>
where
T: Serialize,
{
Expand Down
Loading