-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Feature request: PartialEq<[T]> for set::Slice, PartialEq<[(K, V)]> for map::Slice #375
Comments
You could |
I mean, both options are fair; the latter is best for understanding the failures, but I still was thinking this would be a relatively easy solution that doesn't require any extra dependencies. It's just hard to beat |
I just realized the iterator ways are more annoying for maps, since the items are different: |
```rust impl<K: PartialEq, V: PartialEq> PartialEq<[(K, V)]> for map::Slice<K, V> {...} impl<K: PartialEq, V: PartialEq> PartialEq<map::Slice<K, V>> for [(K, V)] {...} impl<T: PartialEq> PartialEq<[T]> for set::Slice<T> {...} impl<T: PartialEq> PartialEq<set::Slice<T>> for [T] {...} ``` Resolves indexmap-rs#375
Playing with #376, it turns out that's not enough because the latter is an array, and you don't get automatic slice coercion here. I guess we could add impls for arrays too, but the scope is creeping... I also wonder if we should make this more flexible, e.g. |
This would be particularly nice for tests, so that I don't need to construct a new set/map just to assert that the values are in a particular order.
The text was updated successfully, but these errors were encountered: