-
Notifications
You must be signed in to change notification settings - Fork 16
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
get function takes a pointer to usize? #10
Comments
The reason is essentially consistency with the other map types (e.g. |
Seems like a waste of resources to me. |
With inlining and other optimizations, I'd say the main downside to the current situation is syntactic noise. I'd be in favor of merging a pull request that changes these to take the |
Such a change would be a breaking change. If I were to write a PR, would it be approved? |
Other people from @contain-rs/owners can chime in on whether such a minor change is worth breaking backwards compatibility, but if we do merge such a PR, we can bump the crate's version to indicate that there was a breaking change. |
cc @reem |
We have 12 reverse dependencies https://crates.io/crates/vec_map/reverse_dependencies and all of them are presumably going to break if we make this change. That seems way too brutal for something that I'd be surprised to not see inlined away. |
In my opinion, it would be better to get the API right at this early stage of rust instead of breaking later when hundreds of packages depend on this. |
I would have to agree with this. |
I'm fine with it being changed. In all the cases where I used it I was calling Assuming all of the downstream crates aren't using wildcard dependencies, it really shouldn't be that much of an issue anyway. |
Well looking at what happened when libc updated recently, I wouldn't make that assumption. |
Upon reflection, if a trait is ever added, it can trivially dispatch to the proposed interface. So 👍 let's ship it. |
Do we have a consensus here that the get function should take a value? |
@Binero I think so. You can submit a PR if you'd like. |
This was closed in #11. |
Why does the get function (amongst others) take a pointer to usize, as opposed to just a usize?
https://github.com/contain-rs/vec-map/blob/master/src/lib.rs#L433
https://github.com/contain-rs/vec-map/blob/master/src/lib.rs#L457
https://github.com/contain-rs/vec-map/blob/master/src/lib.rs#L475
https://github.com/contain-rs/vec-map/blob/master/src/lib.rs#L475
The text was updated successfully, but these errors were encountered: