diff --git a/Cargo.toml b/Cargo.toml index ad5693d..7f33dc0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,7 @@ debug = [] [dependencies] typenum = "1.12" bitmaps = "2" -sized-chunks = "0.6" +sized-chunks = { version = "0.6", git = "https://github.com/vorner/sized-chunks", branch = "iter-traits" } rand_core = "0.5.1" rand_xoshiro = "0.4" quickcheck = { version = "0.9", optional = true } diff --git a/src/hash/map.rs b/src/hash/map.rs index 02b84ba..3e80053 100644 --- a/src/hash/map.rs +++ b/src/hash/map.rs @@ -1792,6 +1792,7 @@ where // // Iterators /// An iterator over the elements of a map. +#[derive(Clone)] pub struct Iter<'a, K, V> { it: NodeIter<'a, (K, V)>, } diff --git a/src/hash/set.rs b/src/hash/set.rs index 4f1dfee..4a19129 100644 --- a/src/hash/set.rs +++ b/src/hash/set.rs @@ -834,6 +834,7 @@ where // Iterators /// An iterator over the elements of a set. +#[derive(Clone)] pub struct Iter<'a, A> { it: NodeIter<'a, Value>, } diff --git a/src/nodes/btree.rs b/src/nodes/btree.rs index 79a5bc1..d20d98c 100644 --- a/src/nodes/btree.rs +++ b/src/nodes/btree.rs @@ -912,6 +912,7 @@ impl Node { // Iterator /// An iterator over an ordered set. +#[derive(Clone)] pub struct Iter<'a, A> { fwd_path: Vec<(&'a Node, usize)>, back_path: Vec<(&'a Node, usize)>, diff --git a/src/nodes/hamt.rs b/src/nodes/hamt.rs index 8ee6157..49c504a 100644 --- a/src/nodes/hamt.rs +++ b/src/nodes/hamt.rs @@ -472,6 +472,7 @@ impl CollisionNode { // Ref iterator +#[derive(Clone)] pub(crate) struct Iter<'a, A> { count: usize, stack: Vec, HashWidth>>, diff --git a/src/ord/map.rs b/src/ord/map.rs index 14931f7..a0638b5 100644 --- a/src/ord/map.rs +++ b/src/ord/map.rs @@ -1831,6 +1831,7 @@ where // Iterators /// An iterator over the key/value pairs of a map. +#[derive(Clone)] pub struct Iter<'a, K, V> { it: RangedIter<'a, (K, V)>, } diff --git a/src/ord/set.rs b/src/ord/set.rs index 10d692b..b1bf720 100644 --- a/src/ord/set.rs +++ b/src/ord/set.rs @@ -938,6 +938,7 @@ impl Debug for OrdSet { // Iterators /// An iterator over the elements of a set. +#[derive(Clone)] pub struct Iter<'a, A> { it: NodeIter<'a, Value>, } diff --git a/src/vector/mod.rs b/src/vector/mod.rs index 7d54de1..a4f8436 100644 --- a/src/vector/mod.rs +++ b/src/vector/mod.rs @@ -1948,6 +1948,7 @@ impl<'a, A: Clone> From<&'a Vec> for Vector { /// To obtain one, use [`Vector::iter()`][iter]. /// /// [iter]: enum.Vector.html#method.iter +#[derive(Clone)] pub struct Iter<'a, A> { focus: Focus<'a, A>, front_index: usize,