diff --git a/benches/lib.rs b/benches/lib.rs index 7acdc3c0..5f5ad373 100644 --- a/benches/lib.rs +++ b/benches/lib.rs @@ -1,4 +1,5 @@ #![feature(test)] +#![allow(unused_macros)] extern crate test; extern crate rand; diff --git a/src/core/matrix_alga.rs b/src/core/matrix_alga.rs index 4fd5cff9..37b0b27f 100644 --- a/src/core/matrix_alga.rs +++ b/src/core/matrix_alga.rs @@ -215,7 +215,7 @@ impl FiniteDimInnerSpace for MatrixMN match Self::dimension() { 1 => { if vs.len() == 0 { - f(&Self::canonical_basis_element(0)); + let _ = f(&Self::canonical_basis_element(0)); } }, 2 => { @@ -227,7 +227,7 @@ impl FiniteDimInnerSpace for MatrixMN let v = &vs[0]; let res = Self::from_column_slice(&[-v[1], v[0]]); - f(&res.normalize()); + let _ = f(&res.normalize()); } // Otherwise, nothing. @@ -252,11 +252,11 @@ impl FiniteDimInnerSpace for MatrixMN let _ = a.normalize_mut(); if f(&a.cross(v)) { - f(&a); + let _ = f(&a); } } else if vs.len() == 2 { - f(&vs[0].cross(&vs[1]).normalize()); + let _ = f(&vs[0].cross(&vs[1]).normalize()); } }, _ => { diff --git a/src/core/ops.rs b/src/core/ops.rs index 28981128..f303e4d9 100644 --- a/src/core/ops.rs +++ b/src/core/ops.rs @@ -144,7 +144,7 @@ macro_rules! componentwise_binop_impl( if self.data.is_contiguous() && rhs.data.is_contiguous() && out.data.is_contiguous() { let arr1 = self.data.as_slice(); let arr2 = rhs.data.as_slice(); - let mut out = out.data.as_mut_slice(); + let out = out.data.as_mut_slice(); for i in 0 .. arr1.len() { unsafe { *out.get_unchecked_mut(i) = arr1.get_unchecked(i).$method(*arr2.get_unchecked(i)); @@ -175,7 +175,7 @@ macro_rules! componentwise_binop_impl( // This is the most common case and should be deduced at compile-time. // FIXME: use specialization instead? if self.data.is_contiguous() && rhs.data.is_contiguous() { - let mut arr1 = self.data.as_mut_slice(); + let arr1 = self.data.as_mut_slice(); let arr2 = rhs.data.as_slice(); for i in 0 .. arr2.len() { unsafe { @@ -206,7 +206,7 @@ macro_rules! componentwise_binop_impl( // FIXME: use specialization instead? if self.data.is_contiguous() && rhs.data.is_contiguous() { let arr1 = self.data.as_slice(); - let mut arr2 = rhs.data.as_mut_slice(); + let arr2 = rhs.data.as_mut_slice(); for i in 0 .. arr1.len() { unsafe { let res = arr1.get_unchecked(i).$method(*arr2.get_unchecked(i)); @@ -218,7 +218,7 @@ macro_rules! componentwise_binop_impl( for j in 0 .. self.ncols() { for i in 0 .. self.nrows() { unsafe { - let mut r = rhs.get_unchecked_mut(i, j); + let r = rhs.get_unchecked_mut(i, j); *r = self.get_unchecked(i, j).$method(*r) } } diff --git a/src/linalg/cholesky.rs b/src/linalg/cholesky.rs index 7f9f6c0c..a7512854 100644 --- a/src/linalg/cholesky.rs +++ b/src/linalg/cholesky.rs @@ -104,8 +104,8 @@ impl> Cholesky pub fn solve_mut(&self, b: &mut Matrix) where S2: StorageMut, ShapeConstraint: SameNumberOfRows { - self.chol.solve_lower_triangular_mut(b); - self.chol.tr_solve_lower_triangular_mut(b); + let _ = self.chol.solve_lower_triangular_mut(b); + let _ = self.chol.tr_solve_lower_triangular_mut(b); } /// Returns the solution of the system `self * x = b` where `self` is the decomposed matrix and diff --git a/src/linalg/full_piv_lu.rs b/src/linalg/full_piv_lu.rs index bf7f084c..d5f3da9a 100644 --- a/src/linalg/full_piv_lu.rs +++ b/src/linalg/full_piv_lu.rs @@ -175,8 +175,8 @@ impl> FullPivLU if self.is_invertible() { self.p.permute_rows(b); - self.lu.solve_lower_triangular_with_diag_mut(b, N::one()); - self.lu.solve_upper_triangular_mut(b); + let _ = self.lu.solve_lower_triangular_with_diag_mut(b, N::one()); + let _ = self.lu.solve_upper_triangular_mut(b); self.q.inv_permute_rows(b); true diff --git a/src/linalg/lu.rs b/src/linalg/lu.rs index bdf66935..49ae2f60 100644 --- a/src/linalg/lu.rs +++ b/src/linalg/lu.rs @@ -73,7 +73,7 @@ pub fn try_invert_to(mut matrix: MatrixN, } } - matrix.solve_lower_triangular_with_diag_mut(out, N::one()); + let _ = matrix.solve_lower_triangular_with_diag_mut(out, N::one()); matrix.solve_upper_triangular_mut(out) } @@ -216,7 +216,7 @@ impl> LU assert!(self.lu.is_square(), "LU solve: unable to solve a non-square system."); self.p.permute_rows(b); - self.lu.solve_lower_triangular_with_diag_mut(b, N::one()); + let _ = self.lu.solve_lower_triangular_with_diag_mut(b, N::one()); self.lu.solve_upper_triangular_mut(b) } diff --git a/src/linalg/mod.rs b/src/linalg/mod.rs index 53fed898..04f7e3f8 100644 --- a/src/linalg/mod.rs +++ b/src/linalg/mod.rs @@ -1,4 +1,4 @@ -//! Factorization of real matrices. +//! [Reexported at the root of this crate.] Factorization of real matrices. mod solve; mod determinant;