From e40687d8e6ddba17a3ea95cea66a1ec4ef819c91 Mon Sep 17 00:00:00 2001 From: geo-ant <54497890+geo-ant@users.noreply.github.com> Date: Sat, 12 Nov 2022 17:37:18 +0100 Subject: [PATCH] replace confusing trait bounds with Scalar --- src/base/iter.rs | 6 +++--- src/base/par_iter.rs | 16 +++++++--------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/base/iter.rs b/src/base/iter.rs index 0ecd057c..b3f66d81 100644 --- a/src/base/iter.rs +++ b/src/base/iter.rs @@ -447,7 +447,7 @@ mod parallel { impl<'a, T, R: Dim, Cols: Dim, S: RawStorage> Producer for ColumnIter<'a, T, R, Cols, S> where - T: Send + Sync + Debug + PartialEq + Clone + 'static, + T: Send + Sync + Scalar, S: Sync, { type Item = MatrixSlice<'a, T, R, U1, S::RStride, S::CStride>; @@ -473,10 +473,10 @@ mod parallel { } } - impl<'a, T: Scalar, R: Dim, C: Dim, S: 'a + RawStorageMut> Producer + impl<'a, T, R: Dim, C: Dim, S: 'a + RawStorageMut> Producer for ColumnIterMut<'a, T, R, C, S> where - T: Send + Sync + Debug + PartialEq + Clone, + T: Send + Sync + Scalar, S: Send + Sync, { type Item = MatrixSliceMut<'a, T, R, U1, S::RStride, S::CStride>; diff --git a/src/base/par_iter.rs b/src/base/par_iter.rs index 9beccee9..589f7b81 100644 --- a/src/base/par_iter.rs +++ b/src/base/par_iter.rs @@ -3,9 +3,7 @@ use crate::{ iter::{ColumnIter, ColumnIterMut}, - Dim, Matrix, MatrixSlice, MatrixSliceMut, RawStorage, RawStorageMut, U1, -}; -use core::fmt::Debug; + Dim, Matrix, MatrixSlice, MatrixSliceMut, RawStorage, RawStorageMut, U1, Scalar,}; use rayon::{iter::plumbing::bridge, prelude::*}; /// A rayon parallel iterator over the colums of a matrix @@ -23,7 +21,7 @@ impl<'a, T, R: Dim, Cols: Dim, S: RawStorage> ParColumnIter<'a, T, R impl<'a, T, R: Dim, Cols: Dim, S: RawStorage> ParallelIterator for ParColumnIter<'a, T, R, Cols, S> where - T: Sync + Send + Clone + Debug + PartialEq + 'static, + T: Sync + Send + Scalar, S: Sync, { type Item = MatrixSlice<'a, T, R, U1, S::RStride, S::CStride>; @@ -43,7 +41,7 @@ where impl<'a, T, R: Dim, Cols: Dim, S: RawStorage> IndexedParallelIterator for ParColumnIter<'a, T, R, Cols, S> where - T: Send + Sync + Clone + Debug + PartialEq + 'static, + T: Send + Sync + Scalar, S: Sync, { fn len(&self) -> usize { @@ -65,7 +63,7 @@ where impl> Matrix where - T: Send + Sync + Clone + Debug + PartialEq + 'static, + T: Send + Sync + Scalar, S: Sync, { /// Iterate through the columns of the matrix in parallel using rayon. @@ -102,7 +100,7 @@ where R: Dim, Cols: Dim, S: RawStorage + RawStorageMut, - T: Send + Sync + Debug + PartialEq + Clone + 'static, + T: Send + Sync + Scalar, S: Send + Sync, { type Item = MatrixSliceMut<'a, T, R, U1, S::RStride, S::CStride>; @@ -123,7 +121,7 @@ where R: Dim, Cols: Dim, S: RawStorage + RawStorageMut, - T: Send + Sync + Debug + PartialEq + Clone + 'static, + T: Send + Sync + Scalar, S: Send + Sync, { fn drive>(self, consumer: C) -> C::Result { @@ -146,7 +144,7 @@ where impl + RawStorageMut> Matrix where - T: Send + Sync + Clone + Debug + PartialEq + 'static, + T: Send + Sync + Scalar, S: Sync, { /// Mutably iterate through the columns of this matrix in parallel using rayon