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

Require Default on all num types #751

Closed
wants to merge 1 commit into from
Closed

Conversation

nyurik
Copy link
Member

@nyurik nyurik commented Feb 22, 2022

This PR requires georust/proj#110 or georust/proj#111 to be released first. See #746 of a potential solution.

  • Add Default trait constraint to CoordNum and CoordFloat
  • Use CoordFloat instead of ::num_traits::Float for rstar
  • A few minor conditional compilation cleanups
  • 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.

@nyurik nyurik marked this pull request as ready for review February 22, 2022 23:13
nyurik added a commit to nyurik/proj that referenced this pull request Feb 23, 2022
This is an alternative, simpler take on georust#110

Adding default constraint allows georust/geo#751
@nyurik nyurik added blocked and removed blocked labels Feb 23, 2022
geo/CHANGES.md Outdated
@@ -2,7 +2,7 @@

## Unreleased

*
* Add `Default` constraint to all `CoordNum`/`CoordFloat` values.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Add `Default` constraint to all `CoordNum`/`CoordFloat` values.
* BREAKING: Add `Default` constraint to all `CoordNum`/`CoordFloat` values.

This would be a breaking change for geo-types right?

I'm not opposed to the new behavior, but it seems like a pretty small QOL improvement.

As such, I'd advocate for holding off on merging this until we have a batch of other more significant reasons to break geo-types.

What do other people think?

Copy link
Member Author

Choose a reason for hiding this comment

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

@michaelkirk I'm ok to hold off the default trait. What about other changes - should i split them into a separate PR?

Copy link
Member

@michaelkirk michaelkirk Mar 7, 2022

Choose a reason for hiding this comment

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

What about other changes

I'm not sure what remains. Do you mean this?

-    T: ::num_traits::Float + ::rstar_0_9::RTreeNum,
+    T: CoordFloat + ::rstar_0_9::RTreeNum,

Isn't that also a breaking change?

If there's some non-breaking changes that I missed that you'd like merged, I'd recommend splitting them out.

Also use CoordFloat instead of Float in rstar
This PR requires simultaneous modification to the proj repo.

See georust#746
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants