about summary refs log tree commit diff
path: root/src/libstd/sys/common/wtf8.rs
diff options
context:
space:
mode:
authorAlexis <a.beingessner@gmail.com>2015-02-18 10:04:30 -0500
committerAlexis <a.beingessner@gmail.com>2015-02-18 14:01:47 -0500
commit4a9d190423f67a00053f4b5c9869f0ccbdfcc689 (patch)
tree60afef47fda69fcaac8378825244a6cb0c41663a /src/libstd/sys/common/wtf8.rs
parent5fa9de16df87ab844452821acff1b6c74e948327 (diff)
downloadrust-4a9d190423f67a00053f4b5c9869f0ccbdfcc689.tar.gz
rust-4a9d190423f67a00053f4b5c9869f0ccbdfcc689.zip
make Extend use IntoIterator
This breaks all implementors of Extend, as they must now accept IntoIterator instead of Iterator. The fix for this is generally trivial (change the bound, and maybe call into_iter() on the argument to get the old argument).

Users of Extend should be unaffected because Iterators are IntoIterator.

[breaking-change]
Diffstat (limited to 'src/libstd/sys/common/wtf8.rs')
-rw-r--r--src/libstd/sys/common/wtf8.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libstd/sys/common/wtf8.rs b/src/libstd/sys/common/wtf8.rs
index b610f6c370b..e7cb67c6287 100644
--- a/src/libstd/sys/common/wtf8.rs
+++ b/src/libstd/sys/common/wtf8.rs
@@ -32,7 +32,7 @@ use borrow::Cow;
 use cmp;
 use fmt;
 use hash::{Hash, Writer, Hasher};
-use iter::FromIterator;
+use iter::{FromIterator, IntoIterator};
 use mem;
 use num::Int;
 use ops;
@@ -368,7 +368,8 @@ impl FromIterator<CodePoint> for Wtf8Buf {
 /// This replaces surrogate code point pairs with supplementary code points,
 /// like concatenating ill-formed UTF-16 strings effectively would.
 impl Extend<CodePoint> for Wtf8Buf {
-    fn extend<T: Iterator<Item=CodePoint>>(&mut self, iterator: T) {
+    fn extend<T: IntoIterator<Item=CodePoint>>(&mut self, iterable: T) {
+        let iterator = iterable.into_iter();
         let (low, _high) = iterator.size_hint();
         // Lower bound of one byte per code point (ASCII only)
         self.bytes.reserve(low);