about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-11-08 21:06:37 +0000
committerbors <bors@rust-lang.org>2014-11-08 21:06:37 +0000
commitf0ca717c643cbef31859e443ee20db4465ac8864 (patch)
tree05190af84acccdfc795368a8e2431ab3f43038b5 /src/libcore
parentb80edf1d1257bf521fd9e62b732b6302258374e7 (diff)
parenta11f16739f08ec480263ba549d510fffc8ce557e (diff)
downloadrust-f0ca717c643cbef31859e443ee20db4465ac8864.tar.gz
rust-f0ca717c643cbef31859e443ee20db4465ac8864.zip
auto merge of #18475 : gamazeps/rust/toExtend, r=alexcrichton
Ensured that Extend & FromIterator are implemented for the libcollection.

Removed the fact that FromIterator had to be implemented in order to implement Extend, as it did not make sense for LruCache (it needs to be given a size and there are no Default for LruCache).

Changed the name from Extend to Extendable.

Part of #18424 
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/iter.rs5
-rw-r--r--src/libcore/prelude.rs2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs
index 39b319e6ac8..a717d3c2c99 100644
--- a/src/libcore/iter.rs
+++ b/src/libcore/iter.rs
@@ -66,6 +66,7 @@ use num::{Zero, One, CheckedAdd, CheckedSub, Saturating, ToPrimitive, Int};
 use ops::{Add, Mul, Sub};
 use option::{Option, Some, None};
 use uint;
+#[deprecated = "renamed to Extend"] pub use self::Extend as Extendable;
 
 /// Conversion from an `Iterator`
 pub trait FromIterator<A> {
@@ -74,8 +75,8 @@ pub trait FromIterator<A> {
 }
 
 /// A type growable from an `Iterator` implementation
-pub trait Extendable<A>: FromIterator<A> {
-    /// Extend a container with the elements yielded by an iterator
+pub trait Extend<A> {
+    /// Extend a container with the elements yielded by an arbitrary iterator
     fn extend<T: Iterator<A>>(&mut self, iterator: T);
 }
 
diff --git a/src/libcore/prelude.rs b/src/libcore/prelude.rs
index 996f2e56ad3..17f7a04819f 100644
--- a/src/libcore/prelude.rs
+++ b/src/libcore/prelude.rs
@@ -48,7 +48,7 @@ pub use char::Char;
 pub use clone::Clone;
 pub use cmp::{PartialEq, PartialOrd, Eq, Ord};
 pub use cmp::{Ordering, Less, Equal, Greater, Equiv};
-pub use iter::{FromIterator, Extendable};
+pub use iter::{FromIterator, Extend};
 pub use iter::{Iterator, DoubleEndedIterator, RandomAccessIterator, CloneableIterator};
 pub use iter::{OrdIterator, MutableDoubleEndedIterator, ExactSize};
 pub use num::{Num, NumCast, CheckedAdd, CheckedSub, CheckedMul};