Permalink
Please
sign in to comment.
Browse files
Allow collection queries without key references
For both BTree and HashMap, it is possible to have keys whose full value is not used in the equality check. It is sometimes useful to look up items in the map using a newtype that can hash or compare itself with actual keys, without being a valid key itself. This extends (some methods of) these collections to allow more flexible queries. Currently an RFC. Signed-off-by: Daniel De Graaf <code@danieldg.net>
- Loading branch information...
Showing
with
147 additions
and 22 deletions.
- +42 −3 src/liballoc/btree/map.rs
- +5 −7 src/liballoc/btree/search.rs
- +1 −1 src/liballoc/btree/set.rs
- +1 −0 src/liballoc/lib.rs
- +27 −0 src/libcore/cmp.rs
- +14 −0 src/libcore/hash/mod.rs
- +38 −9 src/libstd/collections/hash/map.rs
- +18 −2 src/libstd/collections/hash/set.rs
- +1 −0 src/libstd/lib.rs
0 comments on commit
e3ec035