From 58cf8851f0005e06eefc8e907096bc7834a5ef9a Mon Sep 17 00:00:00 2001 From: Rain Date: Mon, 25 May 2026 15:31:29 -0700 Subject: [PATCH] [spr] initial version Created using spr 1.3.6-beta.1 --- crates/iddqd/src/support/item_set.rs | 58 ---------------------------- 1 file changed, 58 deletions(-) diff --git a/crates/iddqd/src/support/item_set.rs b/crates/iddqd/src/support/item_set.rs index 2cc3535..c38ef1e 100644 --- a/crates/iddqd/src/support/item_set.rs +++ b/crates/iddqd/src/support/item_set.rs @@ -409,12 +409,6 @@ impl ItemSet { Iter::new(self) } - #[inline] - #[expect(dead_code)] - pub(crate) fn iter_mut(&mut self) -> IterMut<'_, T> { - IterMut::new(self) - } - #[inline] pub(crate) fn values(&self) -> Values<'_, T> { Values::new(self) @@ -881,58 +875,6 @@ impl ExactSizeIterator for Iter<'_, T> { impl FusedIterator for Iter<'_, T> {} -/// An iterator over `(index, &mut item)` pairs in an [`ItemSet`]. -pub(crate) struct IterMut<'a, T> { - inner: core::iter::Enumerate>>, - remaining: usize, -} - -impl<'a, T> IterMut<'a, T> { - fn new(set: &'a mut ItemSet) -> Self { - let remaining = set.len(); - Self { inner: set.items.iter_mut().enumerate(), remaining } - } -} - -impl fmt::Debug for IterMut<'_, T> { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("IterMut").field("remaining", &self.remaining).finish() - } -} - -impl<'a, T> Iterator for IterMut<'a, T> { - type Item = (ItemIndex, &'a mut T); - - #[inline] - fn next(&mut self) -> Option { - for (i, slot) in self.inner.by_ref() { - if let ItemSlot::Occupied(v) = slot { - debug_assert!( - self.remaining > 0, - "iterator yielded more items than ItemSet::len()", - ); - self.remaining -= 1; - return Some((ItemIndex::new(i as u32), v)); - } - } - None - } - - #[inline] - fn size_hint(&self) -> (usize, Option) { - (self.remaining, Some(self.remaining)) - } -} - -impl ExactSizeIterator for IterMut<'_, T> { - #[inline] - fn len(&self) -> usize { - self.remaining - } -} - -impl FusedIterator for IterMut<'_, T> {} - /// An iterator over `&item` references in an [`ItemSet`]. pub(crate) struct Values<'a, T> { inner: core::slice::Iter<'a, ItemSlot>,