Skip to content

Commit

Permalink
Update fmt/clippy for rust 1.83 (#43)
Browse files Browse the repository at this point in the history
* fmt

* clippy
  • Loading branch information
kylebarron authored Dec 2, 2024
1 parent 51a95ff commit b61e7d3
Show file tree
Hide file tree
Showing 13 changed files with 245 additions and 63 deletions.
2 changes: 1 addition & 1 deletion src/reader/coord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl<'a> Coord<'a> {
}
}

impl<'a> CoordTrait for Coord<'a> {
impl CoordTrait for Coord<'_> {
type T = f64;

fn dim(&self) -> Dimensions {
Expand Down
200 changes: 160 additions & 40 deletions src/reader/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,46 @@ impl<'a> Wkb<'a> {

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

fn dim(&self) -> Dimensions {
self.dimension().into()
Expand Down Expand Up @@ -122,16 +152,46 @@ impl<'a> GeometryTrait for Wkb<'a> {

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

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

fn dim(&self) -> geo_traits::Dimensions {
self.dimension().into()
Expand All @@ -208,16 +298,46 @@ macro_rules! impl_specialization {

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

fn dim(&self) -> geo_traits::Dimensions {
self.dimension().into()
Expand Down
7 changes: 5 additions & 2 deletions src/reader/geometry_collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ impl<'a> GeometryCollection<'a> {
}
}

impl<'a> GeometryCollectionTrait for GeometryCollection<'a> {
impl GeometryCollectionTrait for GeometryCollection<'_> {
type T = f64;
type GeometryType<'b> = &'b Wkb<'b> where Self: 'b;
type GeometryType<'b>
= &'b Wkb<'b>
where
Self: 'b;

fn dim(&self) -> Dimensions {
self.dim.into()
Expand Down
5 changes: 4 additions & 1 deletion src/reader/linearring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ impl<'a> WKBLinearRing<'a> {

impl<'a> LineStringTrait for WKBLinearRing<'a> {
type T = f64;
type CoordType<'b> = Coord<'a> where Self: 'b;
type CoordType<'b>
= Coord<'a>
where
Self: 'b;

fn dim(&self) -> Dimensions {
self.dim.into()
Expand Down
10 changes: 8 additions & 2 deletions src/reader/linestring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ impl<'a> LineString<'a> {

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

fn dim(&self) -> Dimensions {
self.dim.into()
Expand All @@ -86,7 +89,10 @@ impl<'a> LineStringTrait for LineString<'a> {

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

fn dim(&self) -> Dimensions {
self.dim.into()
Expand Down
10 changes: 8 additions & 2 deletions src/reader/multilinestring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ impl<'a> MultiLineString<'a> {

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

fn dim(&self) -> Dimensions {
self.dim.into()
Expand All @@ -79,7 +82,10 @@ impl<'a> MultiLineStringTrait for MultiLineString<'a> {

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

fn dim(&self) -> Dimensions {
self.dim.into()
Expand Down
10 changes: 8 additions & 2 deletions src/reader/multipoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ impl<'a> MultiPoint<'a> {

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

fn dim(&self) -> Dimensions {
self.dim.into()
Expand All @@ -81,7 +84,10 @@ impl<'a> MultiPointTrait for MultiPoint<'a> {

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

fn dim(&self) -> Dimensions {
self.dim.into()
Expand Down
10 changes: 8 additions & 2 deletions src/reader/multipolygon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ impl<'a> MultiPolygon<'a> {

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

fn dim(&self) -> Dimensions {
self.dim.into()
Expand All @@ -75,7 +78,10 @@ impl<'a> MultiPolygonTrait for MultiPolygon<'a> {

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

fn dim(&self) -> Dimensions {
self.dim.into()
Expand Down
10 changes: 8 additions & 2 deletions src/reader/point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ impl<'a> Point<'a> {

impl<'a> PointTrait for Point<'a> {
type T = f64;
type CoordType<'b> = Coord<'a> where Self: 'b;
type CoordType<'b>
= Coord<'a>
where
Self: 'b;

fn dim(&self) -> Dimensions {
self.dim.into()
Expand All @@ -73,7 +76,10 @@ impl<'a> PointTrait for Point<'a> {

impl<'a> PointTrait for &Point<'a> {
type T = f64;
type CoordType<'b> = Coord<'a> where Self: 'b;
type CoordType<'b>
= Coord<'a>
where
Self: 'b;

fn dim(&self) -> Dimensions {
self.dim.into()
Expand Down
Loading

0 comments on commit b61e7d3

Please sign in to comment.