Skip to content

Commit c52e883

Browse files
committed
---
yaml --- r: 158839 b: refs/heads/snap-stage3 c: a11f167 h: refs/heads/master i: 158837: f96e64c 158835: 2eb6070 158831: 26d1ac1 v: v3
1 parent d957575 commit c52e883

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 0b48001c28329392b26961eaf1c3ed293a352d6f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 16c8cd931cd5ccc9c73b87cac488938556018019
4+
refs/heads/snap-stage3: a11f16739f08ec480263ba549d510fffc8ce557e
55
refs/heads/try: f58aad6dce273570fb130b4df008ef9acd5a5be2
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/libcollections/enum_set.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,22 @@ impl<E:CLike> Iterator<E> for Items<E> {
230230
}
231231
}
232232

233+
impl<E:CLike> FromIterator<E> for EnumSet<E> {
234+
fn from_iter<I:Iterator<E>>(iterator: I) -> EnumSet<E> {
235+
let mut ret = EnumSet::new();
236+
ret.extend(iterator);
237+
ret
238+
}
239+
}
240+
241+
impl<E:CLike> Extend<E> for EnumSet<E> {
242+
fn extend<I: Iterator<E>>(&mut self, mut iterator: I) {
243+
for element in iterator {
244+
self.insert(element);
245+
}
246+
}
247+
}
248+
233249
#[cfg(test)]
234250
mod test {
235251
use std::prelude::*;

branches/snap-stage3/src/libstd/collections/lru_cache.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ use cmp::{PartialEq, Eq};
4141
use collections::HashMap;
4242
use fmt;
4343
use hash::Hash;
44-
use iter::{range, Iterator};
44+
use iter::{range, Iterator, Extend};
4545
use mem;
4646
use ops::Drop;
4747
use option::{Some, None, Option};
@@ -329,6 +329,15 @@ impl<K: Hash + Eq, V> LruCache<K, V> {
329329
/// Clear the cache of all key-value pairs.
330330
#[unstable = "matches collection reform specification, waiting for dust to settle"]
331331
pub fn clear(&mut self) { self.map.clear(); }
332+
333+
}
334+
335+
impl<K: Hash + Eq, V> Extend<(K, V)> for LruCache<K, V> {
336+
fn extend<T: Iterator<(K, V)>>(&mut self, mut iter: T) {
337+
for (k, v) in iter{
338+
self.insert(k, v);
339+
}
340+
}
332341
}
333342

334343
impl<A: fmt::Show + Hash + Eq, B: fmt::Show> fmt::Show for LruCache<A, B> {

0 commit comments

Comments
 (0)