diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-02-18 14:34:08 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-02-18 14:34:08 -0800 |
| commit | 5a32b4a34fc6fbd78e293b16f7ba7d06caca7a48 (patch) | |
| tree | ea0ee2df4161fb0578705cd5f26635db5f3b4a1e /src/libstd/sys/common | |
| parent | 9aee389b6e5a58eb867f4d035729f39e694f51ec (diff) | |
| parent | 66613e26b95438c02e2f5c273c557515454121f7 (diff) | |
| download | rust-5a32b4a34fc6fbd78e293b16f7ba7d06caca7a48.tar.gz rust-5a32b4a34fc6fbd78e293b16f7ba7d06caca7a48.zip | |
rollup merge of #22491: Gankro/into_iter
Conflicts: src/libcollections/bit.rs src/libcollections/linked_list.rs src/libcollections/vec_deque.rs src/libstd/sys/common/wtf8.rs
Diffstat (limited to 'src/libstd/sys/common')
| -rw-r--r-- | src/libstd/sys/common/wtf8.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libstd/sys/common/wtf8.rs b/src/libstd/sys/common/wtf8.rs index c4f2de7fb45..ca3ae1a7a34 100644 --- a/src/libstd/sys/common/wtf8.rs +++ b/src/libstd/sys/common/wtf8.rs @@ -33,7 +33,7 @@ use cmp; use fmt; use hash::{Hash, Hasher}; #[cfg(stage0)] use hash::Writer; -use iter::FromIterator; +use iter::{FromIterator, IntoIterator}; use mem; use num::Int; use ops; @@ -357,9 +357,9 @@ impl Wtf8Buf { /// This replaces surrogate code point pairs with supplementary code points, /// like concatenating ill-formed UTF-16 strings effectively would. impl FromIterator<CodePoint> for Wtf8Buf { - fn from_iter<T: Iterator<Item=CodePoint>>(iterator: T) -> Wtf8Buf { + fn from_iter<T: IntoIterator<Item=CodePoint>>(iter: T) -> Wtf8Buf { let mut string = Wtf8Buf::new(); - string.extend(iterator); + string.extend(iter); string } } @@ -369,7 +369,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); |
