about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-03-23 15:11:09 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-03-23 15:11:09 -0700
commitca7f7cf3d3bbac5dc3e35a28d89def398b6ec988 (patch)
tree32555be8b258c50282cc59edb0fdd5207051730c /src/libstd
parentc7509bb8d88c46d2b0762a4892958bfea9e5d510 (diff)
parent88edf9774caf32ff77e7bad096b624d37cd66b76 (diff)
downloadrust-ca7f7cf3d3bbac5dc3e35a28d89def398b6ec988.tar.gz
rust-ca7f7cf3d3bbac5dc3e35a28d89def398b6ec988.zip
rollup merge of #23637: apasel422/iter
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/collections/hash/set.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs
index de3f080de82..8d69ab430d3 100644
--- a/src/libstd/collections/hash/set.rs
+++ b/src/libstd/collections/hash/set.rs
@@ -853,6 +853,9 @@ impl<T, S> IntoIterator for HashSet<T, S>
     }
 }
 
+impl<'a, K> Clone for Iter<'a, K> {
+    fn clone(&self) -> Iter<'a, K> { Iter { iter: self.iter.clone() } }
+}
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, K> Iterator for Iter<'a, K> {
     type Item = &'a K;
@@ -889,6 +892,12 @@ impl<'a, K> ExactSizeIterator for Drain<'a, K> {
     fn len(&self) -> usize { self.iter.len() }
 }
 
+impl<'a, T, S> Clone for Intersection<'a, T, S> {
+    fn clone(&self) -> Intersection<'a, T, S> {
+        Intersection { iter: self.iter.clone(), ..*self }
+    }
+}
+
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, T, S> Iterator for Intersection<'a, T, S>
     where T: Eq + Hash, S: HashState
@@ -912,6 +921,12 @@ impl<'a, T, S> Iterator for Intersection<'a, T, S>
     }
 }
 
+impl<'a, T, S> Clone for Difference<'a, T, S> {
+    fn clone(&self) -> Difference<'a, T, S> {
+        Difference { iter: self.iter.clone(), ..*self }
+    }
+}
+
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, T, S> Iterator for Difference<'a, T, S>
     where T: Eq + Hash, S: HashState
@@ -935,6 +950,12 @@ impl<'a, T, S> Iterator for Difference<'a, T, S>
     }
 }
 
+impl<'a, T, S> Clone for SymmetricDifference<'a, T, S> {
+    fn clone(&self) -> SymmetricDifference<'a, T, S> {
+        SymmetricDifference { iter: self.iter.clone() }
+    }
+}
+
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, T, S> Iterator for SymmetricDifference<'a, T, S>
     where T: Eq + Hash, S: HashState
@@ -945,6 +966,10 @@ impl<'a, T, S> Iterator for SymmetricDifference<'a, T, S>
     fn size_hint(&self) -> (usize, Option<usize>) { self.iter.size_hint() }
 }
 
+impl<'a, T, S> Clone for Union<'a, T, S> {
+    fn clone(&self) -> Union<'a, T, S> { Union { iter: self.iter.clone() } }
+}
+
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, T, S> Iterator for Union<'a, T, S>
     where T: Eq + Hash, S: HashState