about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/collections/hash/map.rs4
-rw-r--r--src/libstd/collections/hash/set.rs4
-rw-r--r--src/libstd/collections/lru_cache.rs11
-rw-r--r--src/libstd/io/fs.rs2
-rw-r--r--src/libstd/path/posix.rs2
-rw-r--r--src/libstd/path/windows.rs2
-rw-r--r--src/libstd/prelude.rs2
7 files changed, 18 insertions, 9 deletions
diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs
index e164128eeb1..f55ce9ba462 100644
--- a/src/libstd/collections/hash/map.rs
+++ b/src/libstd/collections/hash/map.rs
@@ -15,7 +15,7 @@ use cmp::{max, Eq, Equiv, PartialEq};
 use default::Default;
 use fmt::{mod, Show};
 use hash::{Hash, Hasher, RandomSipHasher};
-use iter::{mod, Iterator, FromIterator, Extendable};
+use iter::{mod, Iterator, FromIterator, Extend};
 use kinds::Sized;
 use mem::{mod, replace};
 use num;
@@ -1449,7 +1449,7 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S> + Default> FromIterator<(K, V)> for Has
     }
 }
 
-impl<K: Eq + Hash<S>, V, S, H: Hasher<S> + Default> Extendable<(K, V)> for HashMap<K, V, H> {
+impl<K: Eq + Hash<S>, V, S, H: Hasher<S> + Default> Extend<(K, V)> for HashMap<K, V, H> {
     fn extend<T: Iterator<(K, V)>>(&mut self, mut iter: T) {
         for (k, v) in iter {
             self.insert(k, v);
diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs
index 58386882ac5..4326fae16fc 100644
--- a/src/libstd/collections/hash/set.rs
+++ b/src/libstd/collections/hash/set.rs
@@ -16,7 +16,7 @@ use default::Default;
 use fmt::Show;
 use fmt;
 use hash::{Hash, Hasher, RandomSipHasher};
-use iter::{Iterator, FromIterator, FilterMap, Chain, Repeat, Zip, Extendable};
+use iter::{Iterator, FromIterator, FilterMap, Chain, Repeat, Zip, Extend};
 use iter;
 use option::{Some, None};
 use result::{Ok, Err};
@@ -574,7 +574,7 @@ impl<T: Eq + Hash<S>, S, H: Hasher<S> + Default> FromIterator<T> for HashSet<T,
     }
 }
 
-impl<T: Eq + Hash<S>, S, H: Hasher<S> + Default> Extendable<T> for HashSet<T, H> {
+impl<T: Eq + Hash<S>, S, H: Hasher<S> + Default> Extend<T> for HashSet<T, H> {
     fn extend<I: Iterator<T>>(&mut self, mut iter: I) {
         for k in iter {
             self.insert(k);
diff --git a/src/libstd/collections/lru_cache.rs b/src/libstd/collections/lru_cache.rs
index aab0924e7e4..94bea37d187 100644
--- a/src/libstd/collections/lru_cache.rs
+++ b/src/libstd/collections/lru_cache.rs
@@ -41,7 +41,7 @@ use cmp::{PartialEq, Eq};
 use collections::HashMap;
 use fmt;
 use hash::Hash;
-use iter::{range, Iterator};
+use iter::{range, Iterator, Extend};
 use mem;
 use ops::Drop;
 use option::{Some, None, Option};
@@ -329,6 +329,15 @@ impl<K: Hash + Eq, V> LruCache<K, V> {
     /// Clear the cache of all key-value pairs.
     #[unstable = "matches collection reform specification, waiting for dust to settle"]
     pub fn clear(&mut self) { self.map.clear(); }
+
+}
+
+impl<K: Hash + Eq, V> Extend<(K, V)> for LruCache<K, V> {
+    fn extend<T: Iterator<(K, V)>>(&mut self, mut iter: T) {
+        for (k, v) in iter{
+            self.insert(k, v);
+        }
+    }
 }
 
 impl<A: fmt::Show + Hash + Eq, B: fmt::Show> fmt::Show for LruCache<A, B> {
diff --git a/src/libstd/io/fs.rs b/src/libstd/io/fs.rs
index c95d2c3f328..e76046bac05 100644
--- a/src/libstd/io/fs.rs
+++ b/src/libstd/io/fs.rs
@@ -60,7 +60,7 @@ use io::{IoResult, IoError, FileStat, SeekStyle, Seek, Writer, Reader};
 use io::{Read, Truncate, SeekCur, SeekSet, ReadWrite, SeekEnd, Append};
 use io::UpdateIoError;
 use io;
-use iter::{Iterator, Extendable};
+use iter::{Iterator, Extend};
 use kinds::Send;
 use libc;
 use option::{Some, None, Option};
diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs
index a927e091840..9918e939097 100644
--- a/src/libstd/path/posix.rs
+++ b/src/libstd/path/posix.rs
@@ -16,7 +16,7 @@ use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering};
 use from_str::FromStr;
 use hash;
 use io::Writer;
-use iter::{DoubleEndedIterator, AdditiveIterator, Extendable, Iterator, Map};
+use iter::{DoubleEndedIterator, AdditiveIterator, Extend, Iterator, Map};
 use option::{Option, None, Some};
 use str::Str;
 use str;
diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs
index c5f84244928..3a5350f0a29 100644
--- a/src/libstd/path/windows.rs
+++ b/src/libstd/path/windows.rs
@@ -19,7 +19,7 @@ use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering};
 use from_str::FromStr;
 use hash;
 use io::Writer;
-use iter::{AdditiveIterator, DoubleEndedIterator, Extendable, Iterator, Map};
+use iter::{AdditiveIterator, DoubleEndedIterator, Extend, Iterator, Map};
 use mem;
 use option::{Option, Some, None};
 use slice::{AsSlice, SlicePrelude};
diff --git a/src/libstd/prelude.rs b/src/libstd/prelude.rs
index 449d3a14bc9..f1090e75127 100644
--- a/src/libstd/prelude.rs
+++ b/src/libstd/prelude.rs
@@ -63,7 +63,7 @@
 #[doc(no_inline)] pub use clone::Clone;
 #[doc(no_inline)] pub use cmp::{PartialEq, PartialOrd, Eq, Ord};
 #[doc(no_inline)] pub use cmp::{Ordering, Less, Equal, Greater, Equiv};
-#[doc(no_inline)] pub use iter::{FromIterator, Extendable, ExactSize};
+#[doc(no_inline)] pub use iter::{FromIterator, Extend, ExactSize};
 #[doc(no_inline)] pub use iter::{Iterator, DoubleEndedIterator};
 #[doc(no_inline)] pub use iter::{RandomAccessIterator, CloneableIterator};
 #[doc(no_inline)] pub use iter::{OrdIterator, MutableDoubleEndedIterator};