kudzu icon indicating copy to clipboard operation
kudzu copied to clipboard

Implement iterators for Map and Set

Open cuviper opened this issue 6 years ago • 1 comments

This adds:

  • Map::{iter, iter_mut, into_iter}
  • Map::{keys, values, values_mut}
  • Set::{difference, symmetric_difference, intersection, union}

We already have Set::{iter, into_iter}, and sets don't usually have iter_mut.

Fixes #1.

cuviper avatar Jun 25 '19 23:06 cuviper

For full parity with std:

  • BTreeMap::{range, range_mut} and BTreeSet::range could be supported
  • HashMap::drain and HashSet::drain might work -- even though kudzu doesn't support removal, it may be possible with exclusive &mut access.
    • same for retain, though that's not really an iterator, rather an iterating callback

cuviper avatar Jun 26 '19 00:06 cuviper