heapless icon indicating copy to clipboard operation
heapless copied to clipboard

Add owning IntoIterator for IndexSet

Open notABot101010 opened this issue 4 months ago • 2 comments

Hello, I was trying to get an owning iterator from an IndexSet, but it seems that the it's currently not implemented.

It's a little bit surprising as IndexSet seems to be basically a wrapper for IndexMap which has an owning implementation for IntoIterator here: https://docs.rs/heapless/latest/heapless/index_map/struct.IndexMap.html#impl-IntoIterator-for-IndexMap%3CK,+V,+S,+N%3E

I would like to add support for an owning IntoIterator for IndexSet, for the keys of the set.

Our use case is to iterate over elements of a deduplicated set.

notABot101010 avatar Nov 02 '25 09:11 notABot101010

I would like to add support for an owning IntoIterator for IndexSet, for the keys of the set.

Sure, why not?

zeenix avatar Nov 03 '25 15:11 zeenix

If you make a PR for it please take the time to implement FusedIterator and ExactSizeIterator on it (other iterators didn't have it until https://github.com/rust-embedded/heapless/pull/628)

sgued avatar Nov 04 '25 12:11 sgued