indexmap-rs / indexmap

A hash table with consistent order and fast iteration; access items by key or sequence index
https://docs.rs/indexmap/
Other
1.71k stars 150 forks source link

Relax some over-constrained impl bounds #296

Closed cuviper closed 9 months ago

cuviper commented 9 months ago

Most of these are removing K: Hash + Eq and/or S: BuildHasher where we don't actually need to hash anything.

In some cases, we only get away with that because we have a saved hash in each entry Bucket. I suspect we still kept the constraints as API protection, in case we ever wanted to change our mind and stop saving the hash. However, there are a few other unconstrained methods that also need the saved hash, like swap_remove_index going back long before version 1.0 of the crate, so that ship has sailed.

cuviper commented 9 months ago

However, there are a few other unconstrained methods that also need the saved hash, like swap_remove_index going back long before version 1.0 of the crate, so that ship has sailed.

Reference: commit 67a04b20b7ee83f1299f9531418adc79f4065a90