Skip to content

Commit a687ae0

Browse files
authored
Impl 'Clone' for 'Iter' (#110)
1 parent 1bbbf35 commit a687ae0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,15 @@ pub struct Iter<'a, T> {
186186
len: usize,
187187
}
188188

189+
impl<'a, T> Clone for Iter<'a, T> {
190+
fn clone(&self) -> Self {
191+
Self {
192+
entries: self.entries.clone(),
193+
len: self.len,
194+
}
195+
}
196+
}
197+
189198
/// A mutable iterator over the values stored in the `Slab`
190199
pub struct IterMut<'a, T> {
191200
entries: iter::Enumerate<slice::IterMut<'a, Entry<T>>>,

0 commit comments

Comments
 (0)