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

Index trait should provide get(&self, key: &Q) -> Option<&V> #1790

Closed
solidsnack opened this issue Nov 14, 2016 · 2 comments
Closed

Index trait should provide get(&self, key: &Q) -> Option<&V> #1790

solidsnack opened this issue Nov 14, 2016 · 2 comments
Labels
T-libs-api Relevant to the library API team, which will review and decide on the RFC.

Comments

@solidsnack
Copy link

  • Or a similar trait should exist and be provided by the standard indexable collections.

  • Or maybe there is a generic way to do this with indexable collections already, in which case it would be nice to see it documented alongside Index.

  • Or a Contains trait with contains(&self, key: &Q) -> bool can be used to similar effect.

@eddyb
Copy link
Member

eddyb commented Nov 14, 2016

Also see #1679.

@solidsnack
Copy link
Author

Will #1679 / rust-lang/rust#35729 apply for BTreeMap and friends? It is unclear to me at first reading since the discussion there is in terms of slices.

@Centril Centril added the T-libs-api Relevant to the library API team, which will review and decide on the RFC. label Feb 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-libs-api Relevant to the library API team, which will review and decide on the RFC.
Projects
None yet
Development

No branches or pull requests

3 participants