Skip to content

Bump geo-traits to 0.3#69

Merged
kylebarron merged 7 commits intomainfrom
kyle/geo-traits-0.3
May 14, 2025
Merged

Bump geo-traits to 0.3#69
kylebarron merged 7 commits intomainfrom
kyle/geo-traits-0.3

Conversation

@kylebarron
Copy link
Copy Markdown
Member

@kylebarron kylebarron commented May 13, 2025

  • I agree to follow the project's code of conduct.
  • I added an entry to CHANGES.md if knowledge of this change could be valuable to users.
  • I ran cargo fmt

Bump to geo-traits 0.3.

Note that this is on top of #68.

@kylebarron kylebarron requested a review from michaelkirk May 13, 2025 15:03
Comment thread src/reader/linearring.rs Outdated
Comment on lines +172 to +179
Self::PolygonType<'a>,
Self::MultiPointType<'a>,
Self::MultiLineStringType<'a>,
Self::MultiPolygonType<'a>,
Self::GeometryCollectionType<'a>,
Self::RectType<'_>,
Self::TriangleType<'_>,
Self::LineType<'_>,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could use a second pair of eyes here. Some of these use the inferred lifetime and some of them use <'a>. I don't know which is right, or if they're both right?

There are a few places throughout the codebase that have similar situations

Copy link
Copy Markdown
Member

@michaelkirk michaelkirk May 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe @Kontinuation has some thoughts since they made a similar PR in #62 - or alternatively, we could update #62 now that its dependency updates have been merged.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think #62 still relies on unreleased features in wkt that were added since 0.13 was released (we haven't released wkt 0.14 yet)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could use a second pair of eyes here. Some of these use the inferred lifetime and some of them use <'a>. I don't know which is right, or if they're both right?

There are a few places throughout the codebase that have similar situations

I believe that we should use '_. Geometry sub-types should be derived using the lifetime in &'_ self, which is '_. This also makes the lifetime annotations consistent with the trait impl for &LinearRing<'a>.

Copy link
Copy Markdown
Contributor

@Kontinuation Kontinuation May 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, please be aware that in #62 I am using concrete types such as Point<'a> instead of using GAT (Self::PointType<'_>), that's why #62 appears to use 'a. But when we switch to use GAT, the situation will become very different.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, please be aware that in #62 I am using concrete types such as Point<'a> instead of using GAT (Self::PointType<'_>), that's why #62 appears to use 'a. But when we switch to use GAT, the situation will become very different.

Is it better to use concrete types than the GATs? Should I switch this PR to use the concrete types with the named 'a lifetime?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. Rust has too many rough edges that I am not aware of. To my best knowledge, it is OK to stick to using GATs. We don't need to switch to use concrete types here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to standardize behavior here in 1732646 (#69). What do you think?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be fine.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Base automatically changed from kyle/bump-wkt-to-0.13 to main May 13, 2025 16:47
@kylebarron
Copy link
Copy Markdown
Member Author

For clarity: the difference between this PR and #62 is that this PR builds on top of #68 to allow us to bump the version of geo-traits here independently from the released version of wkt

Copy link
Copy Markdown
Member

@michaelkirk michaelkirk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a question - but, unless I'm mistaken, the answer is pretty inconsequential, so LGTM!

Comment thread src/reader/linearring.rs Outdated
@kylebarron kylebarron merged commit c87ce43 into main May 14, 2025
1 check passed
@kylebarron kylebarron deleted the kyle/geo-traits-0.3 branch May 14, 2025 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants