-
Notifications
You must be signed in to change notification settings - Fork 200
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
Translation bounds #148
Translation bounds #148
Conversation
I wasn't able to remove all |
Looks like it's not possible to remove the dynamic dispatch in
I'm going to roll back to 9b4a16b so you can merge that. I'll see if I can figure out a clean way of implementing a |
455984b
to
9b4a16b
Compare
Getting rid of all the `&`s would be cool. I tried that, but also ran into weird compiler problems. I was out of my depth, so I just backed off and did the thing that works. If you can figure out a solution that would be cool. 👍
…On 1 September 2017 05:07:30 GMT+02:00, Michael Bryan ***@***.***> wrote:
As we discussed in #147 I've removed the unnecessary `FromPrimitive`
bound on the `Translate` trait.
I also made `MapCoords::map_coords()` generic over any `Fn(&(T, T)) ->
(NT, NT)` so it uses static dispatch instead of dynamic dispatch and
you don't need to write funky `&|&(x, y)| { ... }` borrowed closures
any more.
(fixes #147)
You can view, comment on, or merge this pull request online at:
#148
-- Commit Summary --
* Removed the unnecessary trait bound on Translate
* Made `MapCoords::map_coords()` generic over any Fn()
-- File Changes --
M src/algorithm/map_coords.rs (47)
M src/algorithm/translate.rs (6)
-- Patch Links --
https://github.com/georust/rust-geo/pull/148.patch
https://github.com/georust/rust-geo/pull/148.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#148
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
bors r+ |
148: Translation bounds r=frewsxcv a=Michael-F-Bryan As we discussed in #147 I've removed the unnecessary `FromPrimitive` bound on the `Translate` trait. I also made `MapCoords::map_coords()` generic over any `Fn(&(T, T)) -> (NT, NT)` so it uses static dispatch instead of dynamic dispatch and you don't need to write funky `&|&(x, y)| { ... }` borrowed closures any more. (fixes #147)
Build succeeded |
As we discussed in #147 I've removed the unnecessary
FromPrimitive
bound on theTranslate
trait.I also made
MapCoords::map_coords()
generic over anyFn(&(T, T)) -> (NT, NT)
so it uses static dispatch instead of dynamic dispatch and you don't need to write funky&|&(x, y)| { ... }
borrowed closures any more.(fixes #147)