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

Update fmt/clippy for 1.83 #130

Merged
merged 2 commits into from
Dec 3, 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
6 changes: 3 additions & 3 deletions src/deserialize/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl<T, G: TryFromWkt<T>> Default for TryFromWktVisitor<T, G> {
}
}

impl<'de, T, G> Visitor<'de> for TryFromWktVisitor<T, G>
impl<T, G> Visitor<'_> for TryFromWktVisitor<T, G>
where
T: FromStr + Default + WktNum,
G: TryFromWkt<T>,
Expand Down Expand Up @@ -116,7 +116,7 @@ impl<T> Default for WktVisitor<T> {
}
}

impl<'de, T> Visitor<'de> for WktVisitor<T>
impl<T> Visitor<'_> for WktVisitor<T>
where
T: FromStr + Default + Debug + WktNum,
{
Expand Down Expand Up @@ -156,7 +156,7 @@ impl<T> Default for GeometryVisitor<T> {
}
}

impl<'de, T> Visitor<'de> for GeometryVisitor<T>
impl<T> Visitor<'_> for GeometryVisitor<T>
where
T: FromStr + Default + WktNum,
{
Expand Down
200 changes: 160 additions & 40 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,16 +415,46 @@ where

impl<T: WktNum> GeometryTrait for Wkt<T> {
type T = T;
type PointType<'b> = Point<T> where Self: 'b;
type LineStringType<'b> = LineString<T> where Self: 'b;
type PolygonType<'b> = Polygon<T> where Self: 'b;
type MultiPointType<'b> = MultiPoint<T> where Self: 'b;
type MultiLineStringType<'b> = MultiLineString<T> where Self: 'b;
type MultiPolygonType<'b> = MultiPolygon<T> where Self: 'b;
type GeometryCollectionType<'b> = GeometryCollection<T> where Self: 'b;
type RectType<'b> = geo_traits::UnimplementedRect<T> where Self: 'b;
type LineType<'b> = geo_traits::UnimplementedLine<T> where Self: 'b;
type TriangleType<'b> = geo_traits::UnimplementedTriangle<T> where Self: 'b;
type PointType<'b>
= Point<T>
where
Self: 'b;
type LineStringType<'b>
= LineString<T>
where
Self: 'b;
type PolygonType<'b>
= Polygon<T>
where
Self: 'b;
type MultiPointType<'b>
= MultiPoint<T>
where
Self: 'b;
type MultiLineStringType<'b>
= MultiLineString<T>
where
Self: 'b;
type MultiPolygonType<'b>
= MultiPolygon<T>
where
Self: 'b;
type GeometryCollectionType<'b>
= GeometryCollection<T>
where
Self: 'b;
type RectType<'b>
= geo_traits::UnimplementedRect<T>
where
Self: 'b;
type LineType<'b>
= geo_traits::UnimplementedLine<T>
where
Self: 'b;
type TriangleType<'b>
= geo_traits::UnimplementedTriangle<T>
where
Self: 'b;

fn dim(&self) -> geo_traits::Dimensions {
match self {
Expand Down Expand Up @@ -467,16 +497,46 @@ impl<T: WktNum> GeometryTrait for Wkt<T> {

impl<T: WktNum> GeometryTrait for &Wkt<T> {
type T = T;
type PointType<'b> = Point<T> where Self: 'b;
type LineStringType<'b> = LineString<T> where Self: 'b;
type PolygonType<'b> = Polygon<T> where Self: 'b;
type MultiPointType<'b> = MultiPoint<T> where Self: 'b;
type MultiLineStringType<'b> = MultiLineString<T> where Self: 'b;
type MultiPolygonType<'b> = MultiPolygon<T> where Self: 'b;
type GeometryCollectionType<'b> = GeometryCollection<T> where Self: 'b;
type RectType<'b> = geo_traits::UnimplementedRect<T> where Self: 'b;
type LineType<'b> = geo_traits::UnimplementedLine<T> where Self: 'b;
type TriangleType<'b> = geo_traits::UnimplementedTriangle<T> where Self: 'b;
type PointType<'b>
= Point<T>
where
Self: 'b;
type LineStringType<'b>
= LineString<T>
where
Self: 'b;
type PolygonType<'b>
= Polygon<T>
where
Self: 'b;
type MultiPointType<'b>
= MultiPoint<T>
where
Self: 'b;
type MultiLineStringType<'b>
= MultiLineString<T>
where
Self: 'b;
type MultiPolygonType<'b>
= MultiPolygon<T>
where
Self: 'b;
type GeometryCollectionType<'b>
= GeometryCollection<T>
where
Self: 'b;
type RectType<'b>
= geo_traits::UnimplementedRect<T>
where
Self: 'b;
type LineType<'b>
= geo_traits::UnimplementedLine<T>
where
Self: 'b;
type TriangleType<'b>
= geo_traits::UnimplementedTriangle<T>
where
Self: 'b;

fn dim(&self) -> geo_traits::Dimensions {
match self {
Expand Down Expand Up @@ -523,16 +583,46 @@ macro_rules! impl_specialization {
($geometry_type:ident) => {
impl<T: WktNum> GeometryTrait for $geometry_type<T> {
type T = T;
type PointType<'b> = Point<Self::T> where Self: 'b;
type LineStringType<'b> = LineString<Self::T> where Self: 'b;
type PolygonType<'b> = Polygon<Self::T> where Self: 'b;
type MultiPointType<'b> = MultiPoint<Self::T> where Self: 'b;
type MultiLineStringType<'b> = MultiLineString<Self::T> where Self: 'b;
type MultiPolygonType<'b> = MultiPolygon<Self::T> where Self: 'b;
type GeometryCollectionType<'b> = GeometryCollection<Self::T> where Self: 'b;
type RectType<'b> = geo_traits::UnimplementedRect<T> where Self: 'b;
type LineType<'b> = geo_traits::UnimplementedLine<T> where Self: 'b;
type TriangleType<'b> = geo_traits::UnimplementedTriangle<T> where Self: 'b;
type PointType<'b>
= Point<Self::T>
where
Self: 'b;
type LineStringType<'b>
= LineString<Self::T>
where
Self: 'b;
type PolygonType<'b>
= Polygon<Self::T>
where
Self: 'b;
type MultiPointType<'b>
= MultiPoint<Self::T>
where
Self: 'b;
type MultiLineStringType<'b>
= MultiLineString<Self::T>
where
Self: 'b;
type MultiPolygonType<'b>
= MultiPolygon<Self::T>
where
Self: 'b;
type GeometryCollectionType<'b>
= GeometryCollection<Self::T>
where
Self: 'b;
type RectType<'b>
= geo_traits::UnimplementedRect<T>
where
Self: 'b;
type LineType<'b>
= geo_traits::UnimplementedLine<T>
where
Self: 'b;
type TriangleType<'b>
= geo_traits::UnimplementedTriangle<T>
where
Self: 'b;

fn dim(&self) -> geo_traits::Dimensions {
geo_traits::Dimensions::Xy
Expand All @@ -559,16 +649,46 @@ macro_rules! impl_specialization {

impl<'a, T: WktNum + 'a> GeometryTrait for &'a $geometry_type<T> {
type T = T;
type PointType<'b> = Point<Self::T> where Self: 'b;
type LineStringType<'b> = LineString<Self::T> where Self: 'b;
type PolygonType<'b> = Polygon<Self::T> where Self: 'b;
type MultiPointType<'b> = MultiPoint<Self::T> where Self: 'b;
type MultiLineStringType<'b> = MultiLineString<Self::T> where Self: 'b;
type MultiPolygonType<'b> = MultiPolygon<Self::T> where Self: 'b;
type GeometryCollectionType<'b> = GeometryCollection<Self::T> where Self: 'b;
type RectType<'b> = geo_traits::UnimplementedRect<T> where Self: 'b;
type LineType<'b> = geo_traits::UnimplementedLine<T> where Self: 'b;
type TriangleType<'b> = geo_traits::UnimplementedTriangle<T> where Self: 'b;
type PointType<'b>
= Point<Self::T>
where
Self: 'b;
type LineStringType<'b>
= LineString<Self::T>
where
Self: 'b;
type PolygonType<'b>
= Polygon<Self::T>
where
Self: 'b;
type MultiPointType<'b>
= MultiPoint<Self::T>
where
Self: 'b;
type MultiLineStringType<'b>
= MultiLineString<Self::T>
where
Self: 'b;
type MultiPolygonType<'b>
= MultiPolygon<Self::T>
where
Self: 'b;
type GeometryCollectionType<'b>
= GeometryCollection<Self::T>
where
Self: 'b;
type RectType<'b>
= geo_traits::UnimplementedRect<T>
where
Self: 'b;
type LineType<'b>
= geo_traits::UnimplementedLine<T>
where
Self: 'b;
type TriangleType<'b>
= geo_traits::UnimplementedTriangle<T>
where
Self: 'b;

fn dim(&self) -> geo_traits::Dimensions {
geo_traits::Dimensions::Xy
Expand Down
4 changes: 2 additions & 2 deletions src/tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ where
}
}

impl<'a, T> Iterator for Tokens<'a, T>
impl<T> Iterator for Tokens<'_, T>
where
T: WktNum + str::FromStr,
{
Expand Down Expand Up @@ -102,7 +102,7 @@ where
}
}

impl<'a, T> Tokens<'a, T>
impl<T> Tokens<'_, T>
where
T: str::FromStr,
{
Expand Down
5 changes: 4 additions & 1 deletion src/types/geometrycollection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ where

impl<T: WktNum> GeometryCollectionTrait for GeometryCollection<T> {
type T = T;
type GeometryType<'a> = &'a Wkt<T> where Self: 'a;
type GeometryType<'a>
= &'a Wkt<T>
where
Self: 'a;

fn dim(&self) -> geo_traits::Dimensions {
// TODO: infer dimension from empty WKT
Expand Down
10 changes: 8 additions & 2 deletions src/types/linestring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ where

impl<T: WktNum> LineStringTrait for LineString<T> {
type T = T;
type CoordType<'a> = &'a Coord<T> where Self: 'a;
type CoordType<'a>
= &'a Coord<T>
where
Self: 'a;

fn dim(&self) -> geo_traits::Dimensions {
// TODO: infer dimension from empty WKT
Expand All @@ -77,7 +80,10 @@ impl<T: WktNum> LineStringTrait for LineString<T> {

impl<T: WktNum> LineStringTrait for &LineString<T> {
type T = T;
type CoordType<'a> = &'a Coord<T> where Self: 'a;
type CoordType<'a>
= &'a Coord<T>
where
Self: 'a;

fn dim(&self) -> geo_traits::Dimensions {
// TODO: infer dimension from empty WKT
Expand Down
10 changes: 8 additions & 2 deletions src/types/multilinestring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ where

impl<T: WktNum> MultiLineStringTrait for MultiLineString<T> {
type T = T;
type LineStringType<'a> = &'a LineString<T> where Self: 'a;
type LineStringType<'a>
= &'a LineString<T>
where
Self: 'a;

fn dim(&self) -> geo_traits::Dimensions {
// TODO: infer dimension from empty WKT
Expand All @@ -81,7 +84,10 @@ impl<T: WktNum> MultiLineStringTrait for MultiLineString<T> {

impl<T: WktNum> MultiLineStringTrait for &MultiLineString<T> {
type T = T;
type LineStringType<'a> = &'a LineString<T> where Self: 'a;
type LineStringType<'a>
= &'a LineString<T>
where
Self: 'a;

fn dim(&self) -> geo_traits::Dimensions {
// TODO: infer dimension from empty WKT
Expand Down
10 changes: 8 additions & 2 deletions src/types/multipoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ where

impl<T: WktNum> MultiPointTrait for MultiPoint<T> {
type T = T;
type PointType<'a> = &'a Point<T> where Self: 'a;
type PointType<'a>
= &'a Point<T>
where
Self: 'a;

fn dim(&self) -> geo_traits::Dimensions {
// TODO: infer dimension from empty WKT
Expand All @@ -81,7 +84,10 @@ impl<T: WktNum> MultiPointTrait for MultiPoint<T> {

impl<T: WktNum> MultiPointTrait for &MultiPoint<T> {
type T = T;
type PointType<'a> = &'a Point<T> where Self: 'a;
type PointType<'a>
= &'a Point<T>
where
Self: 'a;

fn dim(&self) -> geo_traits::Dimensions {
// TODO: infer dimension from empty WKT
Expand Down
10 changes: 8 additions & 2 deletions src/types/multipolygon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ where

impl<T: WktNum> MultiPolygonTrait for MultiPolygon<T> {
type T = T;
type PolygonType<'a> = &'a Polygon<T> where Self: 'a;
type PolygonType<'a>
= &'a Polygon<T>
where
Self: 'a;

fn dim(&self) -> geo_traits::Dimensions {
// TODO: infer dimension from empty WKT
Expand All @@ -81,7 +84,10 @@ impl<T: WktNum> MultiPolygonTrait for MultiPolygon<T> {

impl<T: WktNum> MultiPolygonTrait for &MultiPolygon<T> {
type T = T;
type PolygonType<'a> = &'a Polygon<T> where Self: 'a;
type PolygonType<'a>
= &'a Polygon<T>
where
Self: 'a;

fn dim(&self) -> geo_traits::Dimensions {
// TODO: infer dimension from empty WKT
Expand Down
Loading
Loading