-
Notifications
You must be signed in to change notification settings - Fork 205
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
Introduce total_cmp
on GeoNum to avoid unwraps
#1134
Conversation
In particular the latest `home` crate used by bindgen, required by proj, needs rust-1.70+ Also updates CI containers to latest
5d5ff20
to
ac35b65
Compare
Is the TotalOrd trait requirement a result of the MSRV bump? |
Ah, just read the commit message. It's due to a lint introduced in Rust 1.75 |
ac35b65
to
ab1103b
Compare
ab1103b
to
f73379c
Compare
@@ -241,7 +241,7 @@ fn vwp_wrapper<T, const INITIAL_MIN: usize, const MIN_POINTS: usize>( | |||
epsilon: &T, | |||
) -> Vec<Vec<Coord<T>>> | |||
where | |||
T: CoordFloat + RTreeNum + HasKernel, | |||
T: GeoFloat + RTreeNum, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this change I get:
error[E0599]: no method named `intersects` found for struct `CachedEnvelope<geo_types::Line<T>>` in the current scope
This error was happening because the previous constraint, CoordFloat + HasKernel
was enough to hit the impl GeoNum for T
blanket impl. Since GeoFloat is basically CoordFloat + HasKernel
it makes sense to just use GeoFloat to fix this and similar future problems if we add other traits.
This fixes a new lint introduced in rust 1.75 Fixes #1088
f73379c
to
014ed5c
Compare
The previous approach worked, but then there was feedback that the trait should maybe be "more complete" and implemented on additional types. Really, I introduced the trait to solve a problem: we have some undesirable unwraps in the codebase with some of our floating type geometries. I didn't care to actually introduce a general-purpose TotalOrd trait that was useful outside of that context.
There's so little you could do with HasKernel that isn't also a GeoNum. I'm not sure there's value in having two traits.
total_cmp
on GeoNum to avoid unwraps
6b9ad93
to
9ea617b
Compare
9ea617b
to
dfdd025
Compare
@rmanoka - did you want to weigh in on this? I've gotten a few positive responses so far so I'm going to go ahead and merge it in a couple days if I don't hear from you. |
Looks good to me too! +1 for merge. |
CHANGES.md
if knowledge of this change could be valuable to users.In particular the latest
home
crate used by bindgen, required by proj, needs rust-1.70+Also updates CI containers to latest