indexmap icon indicating copy to clipboard operation
indexmap copied to clipboard

Full Consistency With HashMap

Open bluss opened this issue 8 years ago • 4 comments

Missing methods (stable):

  • [x] with_hasher #35
  • [x] hasher #35
  • [x] shrink_to_fit
  • [x] is_empty #22
  • [x] drain #27
  • [x] values, values_mut #17

New methods:

As a rule, we don't implement unstable methods; they are implemented when they are stable in Rust beta

  • [x] get_key_value rust-lang/rust/issues/49347
  • [x] Entry::and_modify (unstable)
  • [x] Entry::or_default (unstable)
  • [ ] try_reserve rust-lang/rust/issues/48043
  • [x] remove_entry rust-lang/rust/issues/46344

Trait impls

  • [x] PartialEq + Eq #23
  • [x] Extend<(&K, &V)> #34
  • [x] Ser/De #28
  • [x] ESI for iterators #26
  • [x] Debug for Entry
  • [x] Clone for some iterators (Keys, Values, Iter, probably all of them)

Type Conflicts:

  • [x] Entry<K, V> vs Entry<K, V, S> (not important) #59
  • [x] retain's &K vs &mut K #39
  • [ ] drain's signature (not important)
  • [x] OccupiedEntry::insert's signature #68

bluss avatar Feb 28 '17 18:02 bluss

#28 implements Ser/De

sugar700 avatar May 20 '17 10:05 sugar700

I can't find any discrepancies between HashSet and OrderSet. A second close look is of course welcome, but I think @cuviper already did this carefully when implementing OrderSet, so it should already be fine.

bluss avatar Feb 01 '18 20:02 bluss

indexmap::map::Keys is not Clone where std::collections::hash_map::Keys is. (Just noticed this moving some code that needed stable ordering over.) Is this an innate limitation or just an oversight?

CAD97 avatar Nov 26 '18 11:11 CAD97

Just an oversight, please check all iterators you can and PRs welcome.

bluss avatar Nov 26 '18 12:11 bluss

I think we are as close as we can get at this point. New additions to std can continue being considered individually.

cuviper avatar Nov 18 '22 18:11 cuviper