Skip to content

Commit

Permalink
Merge pull request #1276 from georust/kyle/clippy-1.83
Browse files Browse the repository at this point in the history
Update fmt and clippy for Rust 1.83
  • Loading branch information
michaelkirk authored Dec 3, 2024
2 parents 41e5ed0 + f9a02c8 commit f4f4710
Show file tree
Hide file tree
Showing 28 changed files with 425 additions and 167 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
matrix:
container_image:
# Use the latest stable version. No need for older versions.
- "ghcr.io/georust/geo-ci:proj-9.4.0-rust-1.79"
- "ghcr.io/georust/geo-ci:proj-9.4.0-rust-1.83"
container:
image: ${{ matrix.container_image }}
steps:
Expand Down
202 changes: 161 additions & 41 deletions geo-traits/src/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,48 @@ where
}

#[cfg(feature = "geo-types")]
impl<'a, T: CoordNum + 'a> GeometryTrait for Geometry<T> {
impl<T: CoordNum> GeometryTrait for Geometry<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> = Rect<Self::T> where Self: 'b;
type TriangleType<'b> = Triangle<Self::T> where Self: 'b;
type LineType<'b> = Line<Self::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>
= Rect<Self::T>
where
Self: 'b;
type TriangleType<'b>
= Triangle<Self::T>
where
Self: 'b;
type LineType<'b>
= Line<Self::T>
where
Self: 'b;

fn dim(&self) -> Dimensions {
Dimensions::Xy
Expand Down Expand Up @@ -176,16 +206,46 @@ impl<'a, T: CoordNum + 'a> GeometryTrait for Geometry<T> {
#[cfg(feature = "geo-types")]
impl<'a, T: CoordNum + 'a> GeometryTrait for &'a Geometry<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> = Rect<Self::T> where Self: 'b;
type TriangleType<'b> = Triangle<Self::T> where Self: 'b;
type LineType<'b> = Line<Self::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>
= Rect<Self::T>
where
Self: 'b;
type TriangleType<'b>
= Triangle<Self::T>
where
Self: 'b;
type LineType<'b>
= Line<Self::T>
where
Self: 'b;

fn dim(&self) -> Dimensions {
Dimensions::Xy
Expand Down Expand Up @@ -228,16 +288,46 @@ macro_rules! impl_specialization {
#[cfg(feature = "geo-types")]
impl<T: CoordNum> 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> = Rect<Self::T> where Self: 'b;
type TriangleType<'b> = Triangle<Self::T> where Self: 'b;
type LineType<'b> = Line<Self::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>
= Rect<Self::T>
where
Self: 'b;
type TriangleType<'b>
= Triangle<Self::T>
where
Self: 'b;
type LineType<'b>
= Line<Self::T>
where
Self: 'b;

fn dim(&self) -> Dimensions {
Dimensions::Xy
Expand Down Expand Up @@ -265,16 +355,46 @@ macro_rules! impl_specialization {
#[cfg(feature = "geo-types")]
impl<'a, T: CoordNum + '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> = Rect<Self::T> where Self: 'b;
type TriangleType<'b> = Triangle<Self::T> where Self: 'b;
type LineType<'b> = Line<Self::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>
= Rect<Self::T>
where
Self: 'b;
type TriangleType<'b>
= Triangle<Self::T>
where
Self: 'b;
type LineType<'b>
= Line<Self::T>
where
Self: 'b;

fn dim(&self) -> Dimensions {
Dimensions::Xy
Expand Down
7 changes: 5 additions & 2 deletions geo-traits/src/geometry_collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ pub trait GeometryCollectionTrait: Sized {
#[cfg(feature = "geo-types")]
impl<T: CoordNum> GeometryCollectionTrait for GeometryCollection<T> {
type T = T;
type GeometryType<'a> = &'a Geometry<Self::T>
type GeometryType<'a>
= &'a Geometry<Self::T>
where
Self: 'a;

Expand All @@ -69,7 +70,9 @@ impl<T: CoordNum> GeometryCollectionTrait for GeometryCollection<T> {
#[cfg(feature = "geo-types")]
impl<'a, T: CoordNum> GeometryCollectionTrait for &'a GeometryCollection<T> {
type T = T;
type GeometryType<'b> = &'a Geometry<Self::T> where
type GeometryType<'b>
= &'a Geometry<Self::T>
where
Self: 'b;

fn dim(&self) -> Dimensions {
Expand Down
15 changes: 12 additions & 3 deletions geo-traits/src/line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ pub trait LineTrait: Sized {
#[cfg(feature = "geo-types")]
impl<T: CoordNum> LineTrait for Line<T> {
type T = T;
type CoordType<'a> = &'a Coord<Self::T> where Self: 'a;
type CoordType<'a>
= &'a Coord<Self::T>
where
Self: 'a;

fn dim(&self) -> Dimensions {
Dimensions::Xy
Expand All @@ -54,7 +57,10 @@ impl<T: CoordNum> LineTrait for Line<T> {
#[cfg(feature = "geo-types")]
impl<'a, T: CoordNum> LineTrait for &'a Line<T> {
type T = T;
type CoordType<'b> = &'a Coord<Self::T> where Self: 'b;
type CoordType<'b>
= &'a Coord<Self::T>
where
Self: 'b;

fn dim(&self) -> Dimensions {
Dimensions::Xy
Expand All @@ -77,7 +83,10 @@ pub struct UnimplementedLine<T>(PhantomData<T>);

impl<T> LineTrait for UnimplementedLine<T> {
type T = T;
type CoordType<'a> = UnimplementedCoord<Self::T> where Self: 'a;
type CoordType<'a>
= UnimplementedCoord<Self::T>
where
Self: 'a;

fn dim(&self) -> Dimensions {
unimplemented!()
Expand Down
15 changes: 12 additions & 3 deletions geo-traits/src/line_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ pub trait LineStringTrait: Sized {
#[cfg(feature = "geo-types")]
impl<T: CoordNum> LineStringTrait for LineString<T> {
type T = T;
type CoordType<'a> = &'a Coord<Self::T> where Self: 'a;
type CoordType<'a>
= &'a Coord<Self::T>
where
Self: 'a;

fn dim(&self) -> Dimensions {
Dimensions::Xy
Expand All @@ -71,7 +74,10 @@ impl<T: CoordNum> LineStringTrait for LineString<T> {
#[cfg(feature = "geo-types")]
impl<'a, T: CoordNum> LineStringTrait for &'a LineString<T> {
type T = T;
type CoordType<'b> = &'a Coord<Self::T> where Self: 'b;
type CoordType<'b>
= &'a Coord<Self::T>
where
Self: 'b;

fn dim(&self) -> Dimensions {
Dimensions::Xy
Expand All @@ -94,7 +100,10 @@ pub struct UnimplementedLineString<T>(PhantomData<T>);

impl<T> LineStringTrait for UnimplementedLineString<T> {
type T = T;
type CoordType<'a> = UnimplementedCoord<Self::T> where Self: 'a;
type CoordType<'a>
= UnimplementedCoord<Self::T>
where
Self: 'a;

fn dim(&self) -> Dimensions {
unimplemented!()
Expand Down
15 changes: 12 additions & 3 deletions geo-traits/src/multi_line_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ pub trait MultiLineStringTrait: Sized {
#[cfg(feature = "geo-types")]
impl<T: CoordNum> MultiLineStringTrait for MultiLineString<T> {
type T = T;
type LineStringType<'a> = &'a LineString<Self::T> where Self: 'a;
type LineStringType<'a>
= &'a LineString<Self::T>
where
Self: 'a;

fn dim(&self) -> Dimensions {
Dimensions::Xy
Expand All @@ -72,7 +75,10 @@ impl<T: CoordNum> MultiLineStringTrait for MultiLineString<T> {
#[cfg(feature = "geo-types")]
impl<'a, T: CoordNum> MultiLineStringTrait for &'a MultiLineString<T> {
type T = T;
type LineStringType<'b> = &'a LineString<Self::T> where Self: 'b;
type LineStringType<'b>
= &'a LineString<Self::T>
where
Self: 'b;

fn dim(&self) -> Dimensions {
Dimensions::Xy
Expand All @@ -95,7 +101,10 @@ pub struct UnimplementedMultiLineString<T>(PhantomData<T>);

impl<T> MultiLineStringTrait for UnimplementedMultiLineString<T> {
type T = T;
type LineStringType<'a> = UnimplementedLineString<Self::T> where Self: 'a;
type LineStringType<'a>
= UnimplementedLineString<Self::T>
where
Self: 'a;

fn dim(&self) -> Dimensions {
unimplemented!()
Expand Down
Loading

0 comments on commit f4f4710

Please sign in to comment.