Fix FromIterator impl.

This commit is contained in:
Sébastien Crozet 2013-08-16 10:14:01 +02:00
parent 5187a1a73f
commit 61e985634b
3 changed files with 6 additions and 6 deletions

View File

@ -46,8 +46,8 @@ impl<N> IterableMut<N> for DVec<N> {
}
}
impl<N, Iter: Iterator<N>> FromIterator<N, Iter> for DVec<N> {
fn from_iterator(mut param: &mut Iter) -> DVec<N> {
impl<N> FromIterator<N> for DVec<N> {
fn from_iterator<I: Iterator<N>>(mut param: &mut I) -> DVec<N> {
let mut res = DVec { at: ~[] };
for e in param {

View File

@ -231,9 +231,9 @@ impl<N: Clone + One> One for vec::Vec0<N> {
}
}
impl<N, Iter: Iterator<N>> FromIterator<N, Iter> for vec::Vec0<N> {
impl<N> FromIterator<N> for vec::Vec0<N> {
#[inline]
fn from_iterator(_: &mut Iter) -> vec::Vec0<N> {
fn from_iterator<I: Iterator<N>>(_: &mut I) -> vec::Vec0<N> {
vec::Vec0
}
}

View File

@ -480,9 +480,9 @@ macro_rules! one_impl(
macro_rules! from_iterator_impl(
($t: ident, $param0: ident $(, $paramN: ident)*) => (
impl<N, Iter: Iterator<N>> FromIterator<N, Iter> for $t<N> {
impl<N> FromIterator<N> for $t<N> {
#[inline]
fn from_iterator($param0: &mut Iter) -> $t<N> {
fn from_iterator<I: Iterator<N>>($param0: &mut I) -> $t<N> {
$t::new($param0.next().unwrap() $(, $paramN.next().unwrap())*)
}
}