rust-embedded / rust-embedded/heapless

Add owning IntoIterator for IndexSet

Open
#627 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2k
Forks
253
Avg merge
1d 2h
Merged PRs (30d)
1

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with IndexSet's iterator entry points and compare them with the owning IntoIterator implementation for IndexMap linked in the issue. Add owning iteration over IndexSet keys and verify that callers can consume a deduplicated set; the payload names no test file, so confirm the behavior with the existing IndexSet iterator tests if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.