Implement Equivalent and Comparable for tuples#10
Conversation
Includes impls up to arity 12, same as `Default` tuple imple in std
|
Did you try compiling this yourself? CI failed, and not just because of the ancient 1.6 -- stable fails too: [etc] In other words, the top-level blanket
I would have expected
Even if we found a way to make this work, I wouldn't bother with that, as folks could enable |
|
I can't see how to solve these overlapping impls without specialization. It's a dead end |
One of the reasons people reach out to hashbrown instead of HashMap from std is to be able to lookup in maps like
HashMap<(String, String), Thing>using(&str, &str). However, in it's current form it requires some newtype boilerplate. This PR aims to fix it by providing impls which make tuplesEquivalentandComparableto other tuples if they areEquivalent/Comparableelement-wise.This will probably also need a corresponding PR to hashbrown repo as well for their fallback
Equivalentdefinition.Impls are included for tuples with arity up to 12 inclusive. The justification for this exact limit is prior art from std, which has the same limits.
I deliberately avoided defining recursive macro to lower the impact on compile times, but it can be changed (this crate is rarely compiled from scratch).