diff --git a/src/base/iter.rs b/src/base/iter.rs index bd6e8fc2..75de156e 100644 --- a/src/base/iter.rs +++ b/src/base/iter.rs @@ -1,5 +1,6 @@ //! Matrix iterators. +use std::iter::FusedIterator; use std::marker::PhantomData; use std::mem; @@ -111,15 +112,6 @@ macro_rules! iterator { } } - impl<'a, N: Scalar, R: Dim, C: Dim, S: 'a + $Storage> ExactSizeIterator - for $Name<'a, N, R, C, S> - { - #[inline] - fn len(&self) -> usize { - self.size - } - } - impl<'a, N: Scalar, R: Dim, C: Dim, S: 'a + $Storage> DoubleEndedIterator for $Name<'a, N, R, C, S> { @@ -157,6 +149,20 @@ macro_rules! iterator { } } } + + impl<'a, N: Scalar, R: Dim, C: Dim, S: 'a + $Storage> ExactSizeIterator + for $Name<'a, N, R, C, S> + { + #[inline] + fn len(&self) -> usize { + self.size + } + } + + impl<'a, N: Scalar, R: Dim, C: Dim, S: 'a + $Storage> FusedIterator + for $Name<'a, N, R, C, S> + { + } }; }