Skip to content

Possible changes for 2.0 #135

Closed
Closed
@cuviper

Description

@cuviper

Let's use this issue to discuss changes for a hypothetical 2.0.

Proposed

  • Increase the MSRV from 1.18.
    • This is not strictly breaking, as we did state the intent to allow increases in minor releases, but in 2.0 we can do this without any fear of harming our dependents.
      • In particular, serde_json supports Rust 1.31.
    • Implement index-sliced key-value iterators #104 wants 1.28 for RangeBounds.
    • Switch to hashbrown's RawTable internally #131 wants 1.32 for hashbrown.
    • 1.34 adds TryFrom/TryInto which may be useful for custom indexing.
    • With 1.36, we could assume alloc support.
    • DONE: We went ahead with MSRV 1.32 in indexmap 1.5, and MSRV 1.36 in 1.6
  • Change the default hasher to something faster.
    • e.g. hashbrown defaults to ahash.
    • Especially with MSRV 1.36, a no_std default would be nice.
    • We can wrap it to avoid committing to a specific public dependency.
  • Parameterize the index type.
    • While we could try to default Idx = usize, this doesn't always work well with type inference.
  • Maybe change the default remove()?
    • (bluss) I still think the current decision is fine, no change from my end for 2.0. (Good way to document this would be to say that "remove is the fastest way to remove an element, and if order should be preserved, ...")
  • std crate feature
  • Consider ordered PartialEq + Eq, more like Vec than HashMap (IndexMap / IndexSet comparison isn't order-aware. #153, map: Make Eq comparisons ordering-aware. #154).
    • This would also allow PartialOrd, Ord, and Hash.
  • get_index_mut should return &K instead of &mut K (Add more Vec/slice-like methods to maps and sets #160 (comment))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions