indexmap icon indicating copy to clipboard operation
indexmap copied to clipboard

Make IndexSet::intersection() work with stdlib's hashset

Open Manishearth opened this issue 4 years ago • 2 comments

There's no reason it shouldn't work with the stdlib hashset. Perhaps we can add a second method for this?

Manishearth avatar Jan 06 '20 06:01 Manishearth

It could work with lots of container types -- anything that has a contains method. But really, intersection amounts to just set.iter().filter(|item| other.contains(item)).

cuviper avatar Jan 07 '20 00:01 cuviper

We don't inadvertently want to be responsible for a traitification of set collections, I guess? It's an awkward question.

bluss avatar Apr 09 '20 14:04 bluss