diff --git a/src/structs/dvec.rs b/src/structs/dvec.rs index 1012b50b..58d7703f 100644 --- a/src/structs/dvec.rs +++ b/src/structs/dvec.rs @@ -68,14 +68,8 @@ impl DVec { impl FromIterator for DVec { #[inline] - fn from_iter>(mut param: I) -> DVec { - let mut res = DVec { at: Vec::new() }; - - for e in param { - res.at.push(e) - } - - res + fn from_iter>(param: I) -> DVec { + DVec { at: param.collect() } } } diff --git a/src/structs/dvec_macros.rs b/src/structs/dvec_macros.rs index 27aa357c..056a4640 100644 --- a/src/structs/dvec_macros.rs +++ b/src/structs/dvec_macros.rs @@ -497,7 +497,7 @@ macro_rules! small_dvec_from_impl ( impl FromIterator for $dvec { #[inline] - fn from_iter>(mut param: I) -> $dvec { + fn from_iter>(param: I) -> $dvec { let mut at: [N; $dim] = [ $( $zeros, )* ]; let mut dim = 0;