Skip to content

Commit e819bc6

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 178095 b: refs/heads/auto c: 9f90d66 h: refs/heads/master i: 178093: 67db614 178091: 44d1ae6 178087: fadf82d 178079: ede6ae2 v: v3
1 parent 031d2c8 commit e819bc6

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: afabb022b026ba021a3bbb0c0c465b6f66a41395
13+
refs/heads/auto: 9f90d666e0cd9a73ef35b76b6605f9d1f69df849
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libstd/collections/hash/set.rs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ use default::Default;
1818
use fmt::Debug;
1919
use fmt;
2020
use hash::{self, Hash};
21-
use iter::{Iterator, ExactSizeIterator, IteratorExt, FromIterator, Map, Chain, Extend};
21+
use iter::{
22+
Iterator, IntoIterator, ExactSizeIterator, IteratorExt, FromIterator, Map, Chain, Extend,
23+
};
2224
use ops::{BitOr, BitAnd, BitXor, Sub};
2325
use option::Option::{Some, None, self};
2426

@@ -833,6 +835,30 @@ pub struct Union<'a, T: 'a, S: 'a> {
833835
iter: Chain<Iter<'a, T>, Difference<'a, T, S>>
834836
}
835837

838+
impl<'a, T, S, H> IntoIterator for &'a HashSet<T, S>
839+
where T: Eq + Hash<H>,
840+
S: HashState<Hasher=H>,
841+
H: hash::Hasher<Output=u64>
842+
{
843+
type Iter = Iter<'a, T>;
844+
845+
fn into_iter(self) -> Iter<'a, T> {
846+
self.iter()
847+
}
848+
}
849+
850+
impl<T, S, H> IntoIterator for HashSet<T, S>
851+
where T: Eq + Hash<H>,
852+
S: HashState<Hasher=H>,
853+
H: hash::Hasher<Output=u64>
854+
{
855+
type Iter = IntoIter<T>;
856+
857+
fn into_iter(self) -> IntoIter<T> {
858+
self.into_iter()
859+
}
860+
}
861+
836862
#[stable(feature = "rust1", since = "1.0.0")]
837863
impl<'a, K> Iterator for Iter<'a, K> {
838864
type Item = &'a K;

0 commit comments

Comments
 (0)