chore: fix clippy (#276)

Co-authored-by: Luis Moreno <morenol@users.noreply.github.com>
This commit is contained in:
morenol
2024-02-25 00:17:30 -05:00
committed by GitHub
parent 4eadd16ce4
commit 80a93c1a0e
2 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -193,11 +193,11 @@ impl<T: Debug + Display + Copy + Sized> DenseMatrix<T> {
/// New instance of `DenseMatrix` from 2d array.
pub fn from_2d_array(values: &[&[T]]) -> Self {
DenseMatrix::from_2d_vec(&values.iter().map(|row| Vec::from(*row)).collect())
DenseMatrix::from_2d_vec(&values.iter().map(|row| Vec::from(*row)).collect::<Vec<_>>())
}
/// New instance of `DenseMatrix` from 2d vector.
pub fn from_2d_vec(values: &Vec<Vec<T>>) -> Self {
pub fn from_2d_vec(values: &[Vec<T>]) -> Self {
let nrows = values.len();
let ncols = values
.first()