diff --git a/nalgebra-lapack/src/cholesky.rs b/nalgebra-lapack/src/cholesky.rs index b271ca51..bc3515a5 100644 --- a/nalgebra-lapack/src/cholesky.rs +++ b/nalgebra-lapack/src/cholesky.rs @@ -80,7 +80,7 @@ where } /// Retrieves the lower-triangular factor of the cholesky decomposition. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn l(&self) -> OMatrix { let mut res = self.l.clone(); res.fill_upper_triangle(Zero::zero(), 1); @@ -92,7 +92,7 @@ where /// /// This is an allocation-less version of `self.l()`. The values of the strict upper-triangular /// part are garbage and should be ignored by further computations. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn l_dirty(&self) -> &OMatrix { &self.l } diff --git a/nalgebra-lapack/src/eigen.rs b/nalgebra-lapack/src/eigen.rs index 993f8987..1bca79a5 100644 --- a/nalgebra-lapack/src/eigen.rs +++ b/nalgebra-lapack/src/eigen.rs @@ -302,7 +302,7 @@ where /// The determinant of the decomposed matrix. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn determinant(&self) -> T { let mut det = T::one(); for e in self.eigenvalues.iter() { diff --git a/nalgebra-lapack/src/hessenberg.rs b/nalgebra-lapack/src/hessenberg.rs index 47018004..c5765022 100644 --- a/nalgebra-lapack/src/hessenberg.rs +++ b/nalgebra-lapack/src/hessenberg.rs @@ -89,7 +89,7 @@ where /// Computes the hessenberg matrix of this decomposition. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn h(&self) -> OMatrix { let mut h = self.h.clone_owned(); h.fill_lower_triangle(T::zero(), 2); @@ -110,7 +110,7 @@ where /// Computes the unitary matrix `Q` of this decomposition. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn q(&self) -> OMatrix { let n = self.h.nrows() as i32; let mut q = self.h.clone_owned(); diff --git a/nalgebra-lapack/src/lu.rs b/nalgebra-lapack/src/lu.rs index a163629d..2130fc7e 100644 --- a/nalgebra-lapack/src/lu.rs +++ b/nalgebra-lapack/src/lu.rs @@ -85,7 +85,7 @@ where /// Gets the lower-triangular matrix part of the decomposition. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn l(&self) -> OMatrix> { let (nrows, ncols) = self.lu.data.shape(); let mut res = self.lu.columns_generic(0, nrows.min(ncols)).into_owned(); @@ -98,7 +98,7 @@ where /// Gets the upper-triangular matrix part of the decomposition. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn u(&self) -> OMatrix, C> { let (nrows, ncols) = self.lu.data.shape(); let mut res = self.lu.rows_generic(0, nrows.min(ncols)).into_owned(); @@ -113,7 +113,7 @@ where /// Computing the permutation matrix explicitly is costly and usually not necessary. /// To permute rows of a matrix or vector, use the method `self.permute(...)` instead. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn p(&self) -> OMatrix { let (dim, _) = self.lu.data.shape(); let mut id = Matrix::identity_generic(dim, dim); @@ -127,7 +127,7 @@ where /// Gets the LAPACK permutation indices. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn permutation_indices(&self) -> &OVector> { &self.p } diff --git a/nalgebra-lapack/src/qr.rs b/nalgebra-lapack/src/qr.rs index 8c32b299..7b2d5df6 100644 --- a/nalgebra-lapack/src/qr.rs +++ b/nalgebra-lapack/src/qr.rs @@ -92,7 +92,7 @@ where /// Retrieves the upper trapezoidal submatrix `R` of this decomposition. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn r(&self) -> OMatrix, C> { let (nrows, ncols) = self.qr.data.shape(); self.qr.rows_generic(0, nrows.min(ncols)).upper_triangle() @@ -118,7 +118,7 @@ where /// Computes the orthogonal matrix `Q` of this decomposition. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn q(&self) -> OMatrix> { let (nrows, ncols) = self.qr.data.shape(); let min_nrows_ncols = nrows.min(ncols); diff --git a/nalgebra-lapack/src/schur.rs b/nalgebra-lapack/src/schur.rs index 602e0ec1..3bee2635 100644 --- a/nalgebra-lapack/src/schur.rs +++ b/nalgebra-lapack/src/schur.rs @@ -138,7 +138,7 @@ where /// Computes the real eigenvalues of the decomposed matrix. /// /// Return `None` if some eigenvalues are complex. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn eigenvalues(&self) -> Option> { if self.im.iter().all(|e| e.is_zero()) { Some(self.re.clone()) @@ -148,7 +148,7 @@ where } /// Computes the complex eigenvalues of the decomposed matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn complex_eigenvalues(&self) -> OVector, D> where DefaultAllocator: Allocator, D>, diff --git a/nalgebra-lapack/src/svd.rs b/nalgebra-lapack/src/svd.rs index 7256e984..3357e621 100644 --- a/nalgebra-lapack/src/svd.rs +++ b/nalgebra-lapack/src/svd.rs @@ -175,7 +175,7 @@ macro_rules! svd_impl( /// /// All singular value below epsilon will be set to zero instead of being inverted. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn pseudo_inverse(&self, epsilon: $t) -> OMatrix<$t, C, R> { let nrows = self.u.data.shape().0; let ncols = self.vt.data.shape().1; @@ -208,7 +208,7 @@ macro_rules! svd_impl( /// This is the number of singular values that are not too small (i.e. greater than /// the given `epsilon`). #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn rank(&self, epsilon: $t) -> usize { let mut i = 0; diff --git a/nalgebra-lapack/src/symmetric_eigen.rs b/nalgebra-lapack/src/symmetric_eigen.rs index d2150598..d276437e 100644 --- a/nalgebra-lapack/src/symmetric_eigen.rs +++ b/nalgebra-lapack/src/symmetric_eigen.rs @@ -138,7 +138,7 @@ where /// The determinant of the decomposed matrix. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn determinant(&self) -> T { let mut det = T::one(); for e in self.eigenvalues.iter() { @@ -151,7 +151,7 @@ where /// Rebuild the original matrix. /// /// This is useful if some of the eigenvalues have been manually modified. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn recompose(&self) -> OMatrix { let mut u_t = self.eigenvectors.clone(); for i in 0..self.eigenvalues.len() { diff --git a/nalgebra-sparse/src/coo.rs b/nalgebra-sparse/src/coo.rs index 820e4e38..caf74654 100644 --- a/nalgebra-sparse/src/coo.rs +++ b/nalgebra-sparse/src/coo.rs @@ -173,14 +173,14 @@ impl CooMatrix { /// The number of rows in the matrix. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn nrows(&self) -> usize { self.nrows } /// The number of columns in the matrix. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn ncols(&self) -> usize { self.ncols } @@ -191,25 +191,25 @@ impl CooMatrix { /// entries, then it may have a different number of non-zeros as reported by `nnz()` compared /// to its CSR representation. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn nnz(&self) -> usize { self.values.len() } /// The row indices of the explicitly stored entries. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn row_indices(&self) -> &[usize] { &self.row_indices } /// The column indices of the explicitly stored entries. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn col_indices(&self) -> &[usize] { &self.col_indices } /// The values of the explicitly stored entries. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn values(&self) -> &[T] { &self.values } diff --git a/nalgebra-sparse/src/cs.rs b/nalgebra-sparse/src/cs.rs index 10492801..a5a65f33 100644 --- a/nalgebra-sparse/src/cs.rs +++ b/nalgebra-sparse/src/cs.rs @@ -32,13 +32,13 @@ impl CsMatrix { } #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn pattern(&self) -> &SparsityPattern { &self.sparsity_pattern } #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn values(&self) -> &[T] { &self.values } @@ -50,7 +50,7 @@ impl CsMatrix { /// Returns the raw data represented as a tuple `(major_offsets, minor_indices, values)`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn cs_data(&self) -> (&[usize], &[usize], &[T]) { let pattern = self.pattern(); ( @@ -91,7 +91,7 @@ impl CsMatrix { /// Internal method for simplifying access to a lane's data #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn get_index_range(&self, row_index: usize) -> Option> { let row_begin = *self.sparsity_pattern.major_offsets().get(row_index)?; let row_end = *self.sparsity_pattern.major_offsets().get(row_index + 1)?; @@ -115,7 +115,7 @@ impl CsMatrix { /// Returns an entry for the given major/minor indices, or `None` if the indices are out /// of bounds. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn get_entry(&self, major_index: usize, minor_index: usize) -> Option> { let row_range = self.get_index_range(major_index)?; let (_, minor_indices, values) = self.cs_data(); @@ -144,7 +144,7 @@ impl CsMatrix { get_mut_entry_from_slices(minor_dim, minor_indices, values, minor_index) } - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn get_lane(&self, index: usize) -> Option> { let range = self.get_index_range(index)?; let (_, minor_indices, values) = self.cs_data(); @@ -178,7 +178,7 @@ impl CsMatrix { } #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn filter

(&self, predicate: P) -> Self where T: Clone, @@ -214,7 +214,7 @@ impl CsMatrix { } /// Returns the diagonal of the matrix as a sparse matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn diagonal_as_matrix(&self) -> Self where T: Clone, @@ -380,31 +380,31 @@ macro_rules! impl_cs_lane_common_methods { ($name:ty) => { impl<'a, T> $name { #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn minor_dim(&self) -> usize { self.minor_dim } #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn nnz(&self) -> usize { self.minor_indices.len() } #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn minor_indices(&self) -> &[usize] { self.minor_indices } #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn values(&self) -> &[T] { self.values } #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn get_entry(&self, global_col_index: usize) -> Option> { get_entry_from_slices( self.minor_dim, diff --git a/nalgebra-sparse/src/csc.rs b/nalgebra-sparse/src/csc.rs index e5fb9465..65e1c409 100644 --- a/nalgebra-sparse/src/csc.rs +++ b/nalgebra-sparse/src/csc.rs @@ -192,14 +192,14 @@ impl CscMatrix { /// The number of rows in the matrix. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn nrows(&self) -> usize { self.cs.pattern().minor_dim() } /// The number of columns in the matrix. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn ncols(&self) -> usize { self.cs.pattern().major_dim() } @@ -210,28 +210,28 @@ impl CscMatrix { /// number of algebraically zero entries in the matrix. Explicitly stored entries can still /// be zero. Corresponds to the number of entries in the sparsity pattern. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn nnz(&self) -> usize { self.pattern().nnz() } /// The column offsets defining part of the CSC format. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn col_offsets(&self) -> &[usize] { self.pattern().major_offsets() } /// The row indices defining part of the CSC format. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn row_indices(&self) -> &[usize] { self.pattern().minor_indices() } /// The non-zero values defining part of the CSC format. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn values(&self) -> &[T] { self.cs.values() } @@ -304,7 +304,7 @@ impl CscMatrix { /// ------ /// Panics if column index is out of bounds. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn col(&self, index: usize) -> CscCol { self.get_col(index).expect("Row index must be in bounds") } @@ -322,7 +322,7 @@ impl CscMatrix { /// Return the column at the given column index, or `None` if out of bounds. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn get_col(&self, index: usize) -> Option> { self.cs.get_lane(index).map(|lane| CscCol { lane }) } @@ -389,7 +389,7 @@ impl CscMatrix { } /// Returns a reference to the underlying sparsity pattern. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn pattern(&self) -> &SparsityPattern { self.cs.pattern() } @@ -406,7 +406,7 @@ impl CscMatrix { /// /// Each call to this function incurs the cost of a binary search among the explicitly /// stored row entries for the given column. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn get_entry(&self, row_index: usize, col_index: usize) -> Option> { self.cs.get_entry(col_index, row_index) } @@ -432,7 +432,7 @@ impl CscMatrix { /// Panics /// ------ /// Panics if `row_index` or `col_index` is out of bounds. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn index_entry(&self, row_index: usize, col_index: usize) -> SparseEntry { self.get_entry(row_index, col_index) .expect("Out of bounds matrix indices encountered") @@ -452,7 +452,7 @@ impl CscMatrix { } /// Returns a triplet of slices `(col_offsets, row_indices, values)` that make up the CSC data. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn csc_data(&self) -> (&[usize], &[usize], &[T]) { self.cs.cs_data() } @@ -465,7 +465,7 @@ impl CscMatrix { /// Creates a sparse matrix that contains only the explicit entries decided by the /// given predicate. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn filter

(&self, predicate: P) -> Self where T: Clone, @@ -483,7 +483,7 @@ impl CscMatrix { /// Returns a new matrix representing the upper triangular part of this matrix. /// /// The result includes the diagonal of the matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn upper_triangle(&self) -> Self where T: Clone, @@ -494,7 +494,7 @@ impl CscMatrix { /// Returns a new matrix representing the lower triangular part of this matrix. /// /// The result includes the diagonal of the matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn lower_triangle(&self) -> Self where T: Clone, @@ -503,7 +503,7 @@ impl CscMatrix { } /// Returns the diagonal of the matrix as a sparse matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn diagonal_as_csc(&self) -> Self where T: Clone, @@ -514,7 +514,7 @@ impl CscMatrix { } /// Compute the transpose of the matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn transpose(&self) -> CscMatrix where T: Scalar, @@ -634,28 +634,28 @@ macro_rules! impl_csc_col_common_methods { impl<'a, T> $name { /// The number of global rows in the column. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn nrows(&self) -> usize { self.lane.minor_dim() } /// The number of non-zeros in this column. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn nnz(&self) -> usize { self.lane.nnz() } /// The row indices corresponding to explicitly stored entries in this column. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn row_indices(&self) -> &[usize] { self.lane.minor_indices() } /// The values corresponding to explicitly stored entries in this column. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn values(&self) -> &[T] { self.lane.values() } @@ -664,7 +664,7 @@ macro_rules! impl_csc_col_common_methods { /// /// Each call to this function incurs the cost of a binary search among the explicitly /// stored row entries. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn get_entry(&self, global_row_index: usize) -> Option> { self.lane.get_entry(global_row_index) } diff --git a/nalgebra-sparse/src/csr.rs b/nalgebra-sparse/src/csr.rs index f5d64627..86b4272c 100644 --- a/nalgebra-sparse/src/csr.rs +++ b/nalgebra-sparse/src/csr.rs @@ -192,14 +192,14 @@ impl CsrMatrix { /// The number of rows in the matrix. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn nrows(&self) -> usize { self.cs.pattern().major_dim() } /// The number of columns in the matrix. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn ncols(&self) -> usize { self.cs.pattern().minor_dim() } @@ -210,14 +210,14 @@ impl CsrMatrix { /// number of algebraically zero entries in the matrix. Explicitly stored entries can still /// be zero. Corresponds to the number of entries in the sparsity pattern. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn nnz(&self) -> usize { self.cs.pattern().nnz() } /// The row offsets defining part of the CSR format. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn row_offsets(&self) -> &[usize] { let (offsets, _, _) = self.cs.cs_data(); offsets @@ -225,7 +225,7 @@ impl CsrMatrix { /// The column indices defining part of the CSR format. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn col_indices(&self) -> &[usize] { let (_, indices, _) = self.cs.cs_data(); indices @@ -233,7 +233,7 @@ impl CsrMatrix { /// The non-zero values defining part of the CSR format. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn values(&self) -> &[T] { self.cs.values() } @@ -306,7 +306,7 @@ impl CsrMatrix { /// ------ /// Panics if row index is out of bounds. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn row(&self, index: usize) -> CsrRow { self.get_row(index).expect("Row index must be in bounds") } @@ -324,7 +324,7 @@ impl CsrMatrix { /// Return the row at the given row index, or `None` if out of bounds. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn get_row(&self, index: usize) -> Option> { self.cs.get_lane(index).map(|lane| CsrRow { lane }) } @@ -391,7 +391,7 @@ impl CsrMatrix { } /// Returns a reference to the underlying sparsity pattern. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn pattern(&self) -> &SparsityPattern { self.cs.pattern() } @@ -408,7 +408,7 @@ impl CsrMatrix { /// /// Each call to this function incurs the cost of a binary search among the explicitly /// stored column entries for the given row. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn get_entry(&self, row_index: usize, col_index: usize) -> Option> { self.cs.get_entry(row_index, col_index) } @@ -434,7 +434,7 @@ impl CsrMatrix { /// Panics /// ------ /// Panics if `row_index` or `col_index` is out of bounds. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn index_entry(&self, row_index: usize, col_index: usize) -> SparseEntry { self.get_entry(row_index, col_index) .expect("Out of bounds matrix indices encountered") @@ -454,7 +454,7 @@ impl CsrMatrix { } /// Returns a triplet of slices `(row_offsets, col_indices, values)` that make up the CSR data. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn csr_data(&self) -> (&[usize], &[usize], &[T]) { self.cs.cs_data() } @@ -467,7 +467,7 @@ impl CsrMatrix { /// Creates a sparse matrix that contains only the explicit entries decided by the /// given predicate. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn filter

(&self, predicate: P) -> Self where T: Clone, @@ -483,7 +483,7 @@ impl CsrMatrix { /// Returns a new matrix representing the upper triangular part of this matrix. /// /// The result includes the diagonal of the matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn upper_triangle(&self) -> Self where T: Clone, @@ -494,7 +494,7 @@ impl CsrMatrix { /// Returns a new matrix representing the lower triangular part of this matrix. /// /// The result includes the diagonal of the matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn lower_triangle(&self) -> Self where T: Clone, @@ -503,7 +503,7 @@ impl CsrMatrix { } /// Returns the diagonal of the matrix as a sparse matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn diagonal_as_csr(&self) -> Self where T: Clone, @@ -514,7 +514,7 @@ impl CsrMatrix { } /// Compute the transpose of the matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn transpose(&self) -> CsrMatrix where T: Scalar, @@ -634,28 +634,28 @@ macro_rules! impl_csr_row_common_methods { impl<'a, T> $name { /// The number of global columns in the row. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn ncols(&self) -> usize { self.lane.minor_dim() } /// The number of non-zeros in this row. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn nnz(&self) -> usize { self.lane.nnz() } /// The column indices corresponding to explicitly stored entries in this row. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn col_indices(&self) -> &[usize] { self.lane.minor_indices() } /// The values corresponding to explicitly stored entries in this row. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn values(&self) -> &[T] { self.lane.values() } @@ -665,7 +665,7 @@ macro_rules! impl_csr_row_common_methods { /// Each call to this function incurs the cost of a binary search among the explicitly /// stored column entries. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn get_entry(&self, global_col_index: usize) -> Option> { self.lane.get_entry(global_col_index) } diff --git a/nalgebra-sparse/src/factorization/cholesky.rs b/nalgebra-sparse/src/factorization/cholesky.rs index 662d82ae..0acc428d 100644 --- a/nalgebra-sparse/src/factorization/cholesky.rs +++ b/nalgebra-sparse/src/factorization/cholesky.rs @@ -42,7 +42,7 @@ impl CscSymbolicCholesky { } /// The pattern of the Cholesky factor `L`. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn l_pattern(&self) -> &SparsityPattern { &self.l_pattern } @@ -172,7 +172,7 @@ impl CscCholesky { } /// Returns a reference to the Cholesky factor `L`. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn l(&self) -> &CscMatrix { &self.l_factor } diff --git a/nalgebra-sparse/src/lib.rs b/nalgebra-sparse/src/lib.rs index a56d0f46..6f28917d 100644 --- a/nalgebra-sparse/src/lib.rs +++ b/nalgebra-sparse/src/lib.rs @@ -170,7 +170,7 @@ pub struct SparseFormatError { impl SparseFormatError { /// The type of error. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn kind(&self) -> &SparseFormatErrorKind { &self.kind } diff --git a/nalgebra-sparse/src/ops/mod.rs b/nalgebra-sparse/src/ops/mod.rs index 1e65ea36..50d25e63 100644 --- a/nalgebra-sparse/src/ops/mod.rs +++ b/nalgebra-sparse/src/ops/mod.rs @@ -140,13 +140,13 @@ pub enum Op { impl Op { /// Returns a reference to the inner value that the operation applies to. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inner_ref(&self) -> &T { self.as_ref().into_inner() } /// Returns an `Op` applied to a reference of the inner value. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn as_ref(&self) -> Op<&T> { match self { Op::NoOp(obj) => Op::NoOp(&obj), diff --git a/nalgebra-sparse/src/ops/serial/mod.rs b/nalgebra-sparse/src/ops/serial/mod.rs index 4a89daa1..4b0cc904 100644 --- a/nalgebra-sparse/src/ops/serial/mod.rs +++ b/nalgebra-sparse/src/ops/serial/mod.rs @@ -96,13 +96,13 @@ impl OperationError { } /// The operation error kind. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn kind(&self) -> &OperationErrorKind { &self.error_kind } /// The underlying error message. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn message(&self) -> &str { self.message.as_str() } diff --git a/nalgebra-sparse/src/pattern.rs b/nalgebra-sparse/src/pattern.rs index 59eedc4c..2e490285 100644 --- a/nalgebra-sparse/src/pattern.rs +++ b/nalgebra-sparse/src/pattern.rs @@ -60,21 +60,21 @@ impl SparsityPattern { /// The offsets for the major dimension. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn major_offsets(&self) -> &[usize] { &self.major_offsets } /// The indices for the minor dimension. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn minor_indices(&self) -> &[usize] { &self.minor_indices } /// The number of major lanes in the pattern. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn major_dim(&self) -> usize { assert!(self.major_offsets.len() > 0); self.major_offsets.len() - 1 @@ -82,14 +82,14 @@ impl SparsityPattern { /// The number of minor lanes in the pattern. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn minor_dim(&self) -> usize { self.minor_dim } /// The number of "non-zeros", i.e. explicitly stored entries in the pattern. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn nnz(&self) -> usize { self.minor_indices.len() } @@ -101,14 +101,14 @@ impl SparsityPattern { /// /// Panics if `major_index` is out of bounds. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn lane(&self, major_index: usize) -> &[usize] { self.get_lane(major_index).unwrap() } /// Get the lane at the given index, or `None` if out of bounds. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn get_lane(&self, major_index: usize) -> Option<&[usize]> { let offset_begin = *self.major_offsets().get(major_index)?; let offset_end = *self.major_offsets().get(major_index + 1)?; @@ -204,7 +204,7 @@ impl SparsityPattern { /// assert_eq!(entries, vec![(0, 0), (0, 2), (1, 1), (2, 0)]); /// ``` /// - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn entries(&self) -> SparsityPatternIter { SparsityPatternIter::from_pattern(self) } @@ -236,7 +236,7 @@ impl SparsityPattern { /// /// This is analogous to matrix transposition, i.e. an entry `(i, j)` becomes `(j, i)` in the /// new pattern. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn transpose(&self) -> Self { // By using unit () values, we can use the same routines as for CSR/CSC matrices let values = vec![(); self.nnz()]; diff --git a/src/base/blas.rs b/src/base/blas.rs index f3e3fb91..9617e46a 100644 --- a/src/base/blas.rs +++ b/src/base/blas.rs @@ -193,7 +193,7 @@ where /// ``` /// #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn dot(&self, rhs: &Matrix) -> T where SB: Storage, @@ -222,7 +222,7 @@ where /// assert_ne!(vec1.dotc(&vec2), vec1.dot(&vec2)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn dotc(&self, rhs: &Matrix) -> T where T: SimdComplexField, @@ -250,7 +250,7 @@ where /// assert_eq!(mat1.tr_dot(&mat2), 9.1); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn tr_dot(&self, rhs: &Matrix) -> T where SB: Storage, diff --git a/src/base/componentwise.rs b/src/base/componentwise.rs index 1a3ad284..02b2cae6 100644 --- a/src/base/componentwise.rs +++ b/src/base/componentwise.rs @@ -28,7 +28,7 @@ impl> Matrix { /// assert_eq!(a.abs(), Matrix2::new(0.0, 1.0, 2.0, 3.0)) /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn abs(&self) -> OMatrix where T: Signed, @@ -50,7 +50,7 @@ macro_rules! component_binop_impl( ($($binop: ident, $binop_mut: ident, $binop_assign: ident, $cmpy: ident, $Trait: ident . $op: ident . $op_assign: ident, $desc:expr, $desc_cmpy:expr, $desc_mut:expr);* $(;)*) => {$( #[doc = $desc] #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn $binop(&self, rhs: &Matrix) -> MatrixComponentOp where T: $Trait, R2: Dim, C2: Dim, @@ -253,7 +253,7 @@ impl> Matrix /// assert_eq!(u.inf(&v), expected) /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inf(&self, other: &Self) -> OMatrix where T: SimdPartialOrd, @@ -274,7 +274,7 @@ impl> Matrix /// assert_eq!(u.sup(&v), expected) /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn sup(&self, other: &Self) -> OMatrix where T: SimdPartialOrd, @@ -295,7 +295,7 @@ impl> Matrix /// assert_eq!(u.inf_sup(&v), expected) /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inf_sup(&self, other: &Self) -> (OMatrix, OMatrix) where T: SimdPartialOrd, diff --git a/src/base/edition.rs b/src/base/edition.rs index 459dfcb2..82c537fc 100644 --- a/src/base/edition.rs +++ b/src/base/edition.rs @@ -18,7 +18,7 @@ use crate::base::{DefaultAllocator, Matrix, OMatrix, RowVector, Scalar, Vector}; impl> Matrix { /// Extracts the upper triangular part of this matrix (including the diagonal). #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn upper_triangle(&self) -> OMatrix where DefaultAllocator: Allocator, @@ -31,7 +31,7 @@ impl> Matrix { /// Extracts the lower triangular part of this matrix (including the diagonal). #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn lower_triangle(&self) -> OMatrix where DefaultAllocator: Allocator, @@ -44,7 +44,7 @@ impl> Matrix { /// Creates a new matrix by extracting the given set of rows from `self`. #[cfg(any(feature = "std", feature = "alloc"))] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn select_rows<'a, I>(&self, irows: I) -> OMatrix where I: IntoIterator, @@ -81,7 +81,7 @@ impl> Matrix { /// Creates a new matrix by extracting the given set of columns from `self`. #[cfg(any(feature = "std", feature = "alloc"))] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn select_columns<'a, I>(&self, icols: I) -> OMatrix where I: IntoIterator, diff --git a/src/base/indexing.rs b/src/base/indexing.rs index aa5ae942..9ddf8776 100644 --- a/src/base/indexing.rs +++ b/src/base/indexing.rs @@ -485,7 +485,7 @@ impl> Matrix { /// Produces a view of the data at the given index, or /// `None` if the index is out of bounds. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn get<'a, I>(&'a self, index: I) -> Option where I: MatrixIndex<'a, T, R, C, S>, @@ -507,7 +507,7 @@ impl> Matrix { /// Produces a view of the data at the given index, or /// panics if the index is out of bounds. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn index<'a, I>(&'a self, index: I) -> I::Output where I: MatrixIndex<'a, T, R, C, S>, @@ -529,7 +529,7 @@ impl> Matrix { /// Produces a view of the data at the given index, without doing /// any bounds checking. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub unsafe fn get_unchecked<'a, I>(&'a self, index: I) -> I::Output where I: MatrixIndex<'a, T, R, C, S>, diff --git a/src/base/interpolation.rs b/src/base/interpolation.rs index 9dd72b5a..d5661e40 100644 --- a/src/base/interpolation.rs +++ b/src/base/interpolation.rs @@ -20,7 +20,7 @@ impl>(&self, rhs: &Vector, t: T) -> OVector where DefaultAllocator: Allocator, @@ -46,7 +46,7 @@ impl>(&self, rhs: &Vector, t: T) -> OVector where T: RealField, @@ -74,7 +74,7 @@ impl> Unit> { /// /// assert_eq!(v, v2); /// ``` - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn slerp>( &self, rhs: &Unit>, @@ -92,7 +92,7 @@ impl> Unit> { /// /// Returns `None` if the two vectors are almost collinear and with opposite direction /// (in this case, there is an infinity of possible results). - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn try_slerp>( &self, rhs: &Unit>, diff --git a/src/base/matrix.rs b/src/base/matrix.rs index ebd22d31..6d2468bb 100644 --- a/src/base/matrix.rs +++ b/src/base/matrix.rs @@ -441,7 +441,7 @@ impl> Matrix { /// let mat = Matrix3x4::::zeros(); /// assert_eq!(mat.shape(), (3, 4)); #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn shape(&self) -> (usize, usize) { let (nrows, ncols) = self.data.shape(); (nrows.value(), ncols.value()) @@ -456,7 +456,7 @@ impl> Matrix { /// let mat = Matrix3x4::::zeros(); /// assert_eq!(mat.nrows(), 3); #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn nrows(&self) -> usize { self.shape().0 } @@ -470,7 +470,7 @@ impl> Matrix { /// let mat = Matrix3x4::::zeros(); /// assert_eq!(mat.ncols(), 4); #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn ncols(&self) -> usize { self.shape().1 } @@ -486,7 +486,7 @@ impl> Matrix { /// // The column strides is the number of steps (here 2) multiplied by the corresponding dimension. /// assert_eq!(mat.strides(), (1, 10)); #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn strides(&self) -> (usize, usize) { let (srows, scols) = self.data.strides(); (srows.value(), scols.value()) @@ -505,7 +505,7 @@ impl> Matrix { /// assert_eq!(m[i], m[3]); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn vector_to_matrix_index(&self, i: usize) -> (usize, usize) { let (nrows, ncols) = self.shape(); @@ -534,7 +534,7 @@ impl> Matrix { /// assert_eq!(unsafe { *ptr }, m[0]); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn as_ptr(&self) -> *const T { self.data.ptr() } @@ -543,7 +543,7 @@ impl> Matrix { /// /// See `relative_eq` from the `RelativeEq` trait for more details. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn relative_eq( &self, other: &Matrix, @@ -566,7 +566,7 @@ impl> Matrix { /// Tests whether `self` and `rhs` are exactly equal. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn eq(&self, other: &Matrix) -> bool where T: PartialEq, @@ -617,7 +617,7 @@ impl> Matrix { /// Clones this matrix to one that owns its data. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn clone_owned(&self) -> OMatrix where DefaultAllocator: Allocator, @@ -628,7 +628,7 @@ impl> Matrix { /// Clones this matrix into one that owns its data. The actual type of the result depends on /// matrix storage combination rules for addition. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn clone_owned_sum(&self) -> MatrixSum where R2: Dim, @@ -702,7 +702,7 @@ impl> Matrix { impl> Matrix { /// Returns a matrix containing the result of `f` applied to each of its entries. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn map T2>(&self, mut f: F) -> OMatrix where DefaultAllocator: Allocator, @@ -749,7 +749,7 @@ impl> Matrix { /// - If the matrix has has least one component, then `init_f` is called with the first component /// to compute the initial value. Folding then continues on all the remaining components of the matrix. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn fold_with( &self, init_f: impl FnOnce(Option<&T>) -> T2, @@ -763,7 +763,7 @@ impl> Matrix { /// Returns a matrix containing the result of `f` applied to each of its entries. Unlike `map`, /// `f` also gets passed the row and column index, i.e. `f(row, col, value)`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn map_with_location T2>( &self, mut f: F, @@ -791,7 +791,7 @@ impl> Matrix { /// Returns a matrix containing the result of `f` applied to each entries of `self` and /// `rhs`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn zip_map(&self, rhs: &Matrix, mut f: F) -> OMatrix where T2: Scalar, @@ -827,7 +827,7 @@ impl> Matrix { /// Returns a matrix containing the result of `f` applied to each entries of `self` and /// `b`, and `c`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn zip_zip_map( &self, b: &Matrix, @@ -875,7 +875,7 @@ impl> Matrix { /// Folds a function `f` on each entry of `self`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn fold(&self, init: Acc, mut f: impl FnMut(Acc, T) -> Acc) -> Acc { let (nrows, ncols) = self.data.shape(); @@ -895,7 +895,7 @@ impl> Matrix { /// Folds a function `f` on each pairs of entries from `self` and `rhs`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn zip_fold( &self, rhs: &Matrix, @@ -1255,7 +1255,7 @@ impl> Matrix { impl> Vector { /// Gets a reference to the i-th element of this column vector without bound checking. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub unsafe fn vget_unchecked(&self, i: usize) -> &T { debug_assert!(i < self.nrows(), "Vector index out of bounds."); let i = i * self.strides().0; @@ -1276,7 +1276,7 @@ impl> Vector { impl> Matrix { /// Extracts a slice containing the entire matrix entries ordered column-by-columns. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn as_slice(&self) -> &[T] { self.data.as_slice() } @@ -1465,7 +1465,7 @@ impl> Matrix { impl> SquareMatrix { /// The diagonal of this matrix. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn diagonal(&self) -> OVector where DefaultAllocator: Allocator, @@ -1477,7 +1477,7 @@ impl> SquareMatrix { /// /// This is a more efficient version of `self.diagonal().map(f)` since this /// allocates only once. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn map_diagonal(&self, mut f: impl FnMut(T) -> T2) -> OVector where DefaultAllocator: Allocator, @@ -1502,7 +1502,7 @@ impl> SquareMatrix { /// Computes a trace of a square matrix, i.e., the sum of its diagonal elements. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn trace(&self) -> T where T: Scalar + Zero + ClosedAdd, @@ -1526,7 +1526,7 @@ impl> SquareMatrix { impl> SquareMatrix { /// The symmetric part of `self`, i.e., `0.5 * (self + self.transpose())`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn symmetric_part(&self) -> OMatrix where DefaultAllocator: Allocator, @@ -1543,7 +1543,7 @@ impl> SquareMatrix { /// The hermitian part of `self`, i.e., `0.5 * (self + self.adjoint())`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn hermitian_part(&self) -> OMatrix where DefaultAllocator: Allocator, @@ -1566,7 +1566,7 @@ impl + IsNotStaticOne, S: Storage /// Yields the homogeneous matrix for this matrix, i.e., appending an additional dimension and /// and setting the diagonal element to `1`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn to_homogeneous(&self) -> OMatrix, DimSum> where DefaultAllocator: Allocator, DimSum>, @@ -1587,7 +1587,7 @@ impl, S: Storage> Vector { /// Computes the coordinates in projective space of this vector, i.e., appends a `0` to its /// coordinates. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn to_homogeneous(&self) -> OVector> where DefaultAllocator: Allocator>, @@ -1615,7 +1615,7 @@ impl, S: Storage> Vector { impl, S: Storage> Vector { /// Constructs a new vector of higher dimension by appending `element` to the end of `self`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn push(&self, element: T) -> OVector> where DefaultAllocator: Allocator>, @@ -1918,7 +1918,7 @@ impl(&self, b: &Matrix) -> T where R2: Dim, @@ -1948,7 +1948,7 @@ impl(&self, b: &Matrix) -> MatrixCross where R2: Dim, @@ -2022,7 +2022,7 @@ impl> Vector { /// Computes the matrix `M` such that for all vector `v` we have `M * v == self.cross(&v)`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn cross_matrix(&self) -> OMatrix { OMatrix::::new( T::zero(), @@ -2041,7 +2041,7 @@ impl> Vector { impl> Matrix { /// The smallest angle between two vectors. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn angle(&self, other: &Matrix) -> T::SimdRealField where SB: Storage, diff --git a/src/base/matrix_slice.rs b/src/base/matrix_slice.rs index 646acbc6..ffe95c8a 100644 --- a/src/base/matrix_slice.rs +++ b/src/base/matrix_slice.rs @@ -812,7 +812,7 @@ impl> Matrix { /// Slices a sub-matrix containing the rows indexed by the range `rows` and the columns indexed /// by the range `cols`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn slice_range( &self, rows: RowRange, @@ -831,7 +831,7 @@ impl> Matrix { /// Slice containing all the rows indexed by the range `rows`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn rows_range>( &self, rows: RowRange, @@ -841,7 +841,7 @@ impl> Matrix { /// Slice containing all the columns indexed by the range `rows`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn columns_range>( &self, cols: ColRange, diff --git a/src/base/min_max.rs b/src/base/min_max.rs index ba109380..83e62d10 100644 --- a/src/base/min_max.rs +++ b/src/base/min_max.rs @@ -13,7 +13,7 @@ impl> Matrix { /// assert_eq!(Vector3::new(-1.0, -2.0, -3.0).amax(), 3.0); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn amax(&self) -> T where T: Zero + SimdSigned + SimdPartialOrd, @@ -34,7 +34,7 @@ impl> Matrix { /// Complex::new(1.0, 3.0)).camax(), 5.0); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn camax(&self) -> T::SimdRealField where T: SimdComplexField, @@ -54,7 +54,7 @@ impl> Matrix { /// assert_eq!(Vector3::new(5u32, 2, 3).max(), 5); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn max(&self) -> T where T: SimdPartialOrd + Zero, @@ -73,7 +73,7 @@ impl> Matrix { /// assert_eq!(Vector3::new(10.0, 2.0, 30.0).amin(), 2.0); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn amin(&self) -> T where T: Zero + SimdPartialOrd + SimdSigned, @@ -94,7 +94,7 @@ impl> Matrix { /// Complex::new(1.0, 3.0)).camin(), 3.0); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn camin(&self) -> T::SimdRealField where T: SimdComplexField, @@ -117,7 +117,7 @@ impl> Matrix { /// assert_eq!(Vector3::new(5u32, 2, 3).min(), 2); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn min(&self) -> T where T: SimdPartialOrd + Zero, @@ -142,7 +142,7 @@ impl> Matrix { /// assert_eq!(mat.icamax_full(), (1, 0)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn icamax_full(&self) -> (usize, usize) where T: ComplexField, @@ -179,7 +179,7 @@ impl> Matri /// assert_eq!(mat.iamax_full(), (1, 2)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn iamax_full(&self) -> (usize, usize) { assert!(!self.is_empty(), "The input matrix must not be empty."); @@ -217,7 +217,7 @@ impl> Vector { /// assert_eq!(vec.icamax(), 2); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn icamax(&self) -> usize where T: ComplexField, @@ -249,7 +249,7 @@ impl> Vector { /// assert_eq!(vec.argmax(), (2, 13)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn argmax(&self) -> (usize, T) where T: PartialOrd, @@ -281,7 +281,7 @@ impl> Vector { /// assert_eq!(vec.imax(), 2); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn imax(&self) -> usize where T: PartialOrd, @@ -299,7 +299,7 @@ impl> Vector { /// assert_eq!(vec.iamax(), 1); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn iamax(&self) -> usize where T: PartialOrd + Signed, @@ -331,7 +331,7 @@ impl> Vector { /// assert_eq!(vec.argmin(), (1, -15)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn argmin(&self) -> (usize, T) where T: PartialOrd, @@ -363,7 +363,7 @@ impl> Vector { /// assert_eq!(vec.imin(), 1); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn imin(&self) -> usize where T: PartialOrd, @@ -381,7 +381,7 @@ impl> Vector { /// assert_eq!(vec.iamin(), 0); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn iamin(&self) -> usize where T: PartialOrd + Signed, diff --git a/src/base/norm.rs b/src/base/norm.rs index 0cf42906..d0c96cd3 100644 --- a/src/base/norm.rs +++ b/src/base/norm.rs @@ -158,7 +158,7 @@ impl Norm for UniformNorm { impl> Matrix { /// The squared L2 norm of this vector. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn norm_squared(&self) -> T::SimdRealField where T: SimdComplexField, @@ -177,7 +177,7 @@ impl> Matrix { /// /// Use `.apply_norm` to apply a custom norm. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn norm(&self) -> T::SimdRealField where T: SimdComplexField, @@ -189,7 +189,7 @@ impl> Matrix { /// /// Use `.apply_metric_distance` to apply a custom norm. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn metric_distance(&self, rhs: &Matrix) -> T::SimdRealField where T: SimdComplexField, @@ -214,7 +214,7 @@ impl> Matrix { /// assert_eq!(v.apply_norm(&EuclideanNorm), v.norm()); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn apply_norm(&self, norm: &impl Norm) -> T::SimdRealField where T: SimdComplexField, @@ -237,7 +237,7 @@ impl> Matrix { /// assert_eq!(v1.apply_metric_distance(&v2, &EuclideanNorm), (v1 - v2).norm()); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn apply_metric_distance( &self, rhs: &Matrix, @@ -259,7 +259,7 @@ impl> Matrix { /// /// This function is simply implemented as a call to `norm()` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn magnitude(&self) -> T::SimdRealField where T: SimdComplexField, @@ -273,7 +273,7 @@ impl> Matrix { /// /// This function is simply implemented as a call to `norm_squared()` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn magnitude_squared(&self) -> T::SimdRealField where T: SimdComplexField, @@ -305,7 +305,7 @@ impl> Matrix { /// The Lp norm of this matrix. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn lp_norm(&self, p: i32) -> T::SimdRealField where T: SimdComplexField, diff --git a/src/base/ops.rs b/src/base/ops.rs index b23a85e6..d9be71a7 100644 --- a/src/base/ops.rs +++ b/src/base/ops.rs @@ -676,7 +676,7 @@ where { /// Equivalent to `self.transpose() * rhs`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn tr_mul(&self, rhs: &Matrix) -> OMatrix where SB: Storage, @@ -693,7 +693,7 @@ where /// Equivalent to `self.adjoint() * rhs`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn ad_mul(&self, rhs: &Matrix) -> OMatrix where T: SimdComplexField, @@ -803,7 +803,7 @@ where /// The kronecker product of two matrices (aka. tensor product of the corresponding linear /// maps). - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn kronecker( &self, rhs: &Matrix, diff --git a/src/base/properties.rs b/src/base/properties.rs index e5645ce0..9e250119 100644 --- a/src/base/properties.rs +++ b/src/base/properties.rs @@ -20,7 +20,7 @@ impl> Matrix { /// assert_eq!(mat.len(), 12); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn len(&self) -> usize { let (nrows, ncols) = self.shape(); nrows * ncols @@ -36,14 +36,14 @@ impl> Matrix { /// assert!(!mat.is_empty()); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn is_empty(&self) -> bool { self.len() == 0 } /// Indicates if this is a square matrix. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn is_square(&self) -> bool { let (nrows, ncols) = self.shape(); nrows == ncols @@ -55,7 +55,7 @@ impl> Matrix { /// If the matrix is diagonal, this checks that diagonal elements (i.e. at coordinates `(i, i)` /// for i from `0` to `min(R, C)`) are equal one; and that all other elements are zero. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn is_identity(&self, eps: T::Epsilon) -> bool where T: Zero + One + RelativeEq, @@ -116,7 +116,7 @@ impl> Matrix { /// In this definition `Id` is approximately equal to the identity matrix with a relative error /// equal to `eps`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn is_orthogonal(&self, eps: T::Epsilon) -> bool where T: Zero + One + ClosedAdd + ClosedMul + RelativeEq, @@ -134,7 +134,7 @@ where { /// Checks that this matrix is orthogonal and has a determinant equal to 1. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn is_special_orthogonal(&self, eps: T) -> bool where D: DimMin, @@ -145,7 +145,7 @@ where /// Returns `true` if this matrix is invertible. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn is_invertible(&self) -> bool { // TODO: improve this? self.clone_owned().try_inverse().is_some() diff --git a/src/base/statistics.rs b/src/base/statistics.rs index 0b3a8279..59d78482 100644 --- a/src/base/statistics.rs +++ b/src/base/statistics.rs @@ -9,7 +9,7 @@ impl> Matrix { /// Returns a row vector where each element is the result of the application of `f` on the /// corresponding column of the original matrix. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn compress_rows( &self, f: impl Fn(VectorSlice) -> T, @@ -36,7 +36,7 @@ impl> Matrix { /// /// This is the same as `self.compress_rows(f).transpose()`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn compress_rows_tr( &self, f: impl Fn(VectorSlice) -> T, @@ -60,7 +60,7 @@ impl> Matrix { /// Returns a column vector resulting from the folding of `f` on each column of this matrix. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn compress_columns( &self, init: OVector, @@ -98,7 +98,7 @@ impl> Matrix { /// assert_eq!(m.sum(), 21.0); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn sum(&self) -> T where T: ClosedAdd + Zero, @@ -124,7 +124,7 @@ impl> Matrix { /// assert_eq!(mint.row_sum(), RowVector2::new(9,12)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn row_sum(&self) -> RowOVector where T: ClosedAdd + Zero, @@ -149,7 +149,7 @@ impl> Matrix { /// assert_eq!(mint.row_sum_tr(), Vector2::new(9,12)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn row_sum_tr(&self) -> OVector where T: ClosedAdd + Zero, @@ -174,7 +174,7 @@ impl> Matrix { /// assert_eq!(mint.column_sum(), Vector3::new(3,7,11)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn column_sum(&self) -> OVector where T: ClosedAdd + Zero, @@ -204,7 +204,7 @@ impl> Matrix { /// assert_relative_eq!(m.variance(), 35.0 / 12.0, epsilon = 1.0e-8); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn variance(&self) -> T where T: Field + SupersetOf, @@ -234,7 +234,7 @@ impl> Matrix { /// assert_eq!(m.row_variance(), RowVector3::new(2.25, 2.25, 2.25)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn row_variance(&self) -> RowOVector where T: Field + SupersetOf, @@ -255,7 +255,7 @@ impl> Matrix { /// assert_eq!(m.row_variance_tr(), Vector3::new(2.25, 2.25, 2.25)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn row_variance_tr(&self) -> OVector where T: Field + SupersetOf, @@ -277,7 +277,7 @@ impl> Matrix { /// assert_relative_eq!(m.column_variance(), Vector2::new(2.0 / 3.0, 2.0 / 3.0), epsilon = 1.0e-8); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn column_variance(&self) -> OVector where T: Field + SupersetOf, @@ -317,7 +317,7 @@ impl> Matrix { /// assert_eq!(m.mean(), 3.5); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn mean(&self) -> T where T: Field + SupersetOf, @@ -343,7 +343,7 @@ impl> Matrix { /// assert_eq!(m.row_mean(), RowVector3::new(2.5, 3.5, 4.5)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn row_mean(&self) -> RowOVector where T: Field + SupersetOf, @@ -364,7 +364,7 @@ impl> Matrix { /// assert_eq!(m.row_mean_tr(), Vector3::new(2.5, 3.5, 4.5)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn row_mean_tr(&self) -> OVector where T: Field + SupersetOf, @@ -385,7 +385,7 @@ impl> Matrix { /// assert_eq!(m.column_mean(), Vector2::new(2.0, 5.0)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn column_mean(&self) -> OVector where T: Field + SupersetOf, diff --git a/src/base/swizzle.rs b/src/base/swizzle.rs index 76fecda2..25d6375f 100644 --- a/src/base/swizzle.rs +++ b/src/base/swizzle.rs @@ -8,7 +8,7 @@ macro_rules! impl_swizzle { $( /// Builds a new vector from components of `self`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn $name(&self) -> $Result where D::Typenum: Cmp { $Result::new($(self[$i].inlined_clone()),*) diff --git a/src/base/vec_storage.rs b/src/base/vec_storage.rs index 48a25b20..14490674 100644 --- a/src/base/vec_storage.rs +++ b/src/base/vec_storage.rs @@ -95,7 +95,7 @@ impl VecStorage { /// The underlying data storage. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn as_vec(&self) -> &Vec { &self.data } @@ -130,14 +130,14 @@ impl VecStorage { /// The number of elements on the underlying vector. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn len(&self) -> usize { self.data.len() } /// Returns true if the underlying vector contains no elements. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn is_empty(&self) -> bool { self.len() == 0 } diff --git a/src/geometry/dual_quaternion.rs b/src/geometry/dual_quaternion.rs index 04252b22..83912b9e 100644 --- a/src/geometry/dual_quaternion.rs +++ b/src/geometry/dual_quaternion.rs @@ -232,7 +232,7 @@ where /// )); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn lerp(&self, other: &Self, t: T) -> Self { self * (T::one() - t) + other * t } @@ -382,7 +382,7 @@ where /// )); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn dual_quaternion(&self) -> &DualQuaternion { self.as_ref() } @@ -487,7 +487,7 @@ where /// assert_relative_eq!(dq_to * dq1, dq2, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn isometry_to(&self, other: &Self) -> Self { other / self } @@ -520,7 +520,7 @@ where /// ); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn lerp(&self, other: &Self, t: T) -> DualQuaternion { self.as_ref().lerp(other.as_ref(), t) } @@ -549,7 +549,7 @@ where /// ), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn nlerp(&self, other: &Self, t: T) -> Self { let mut res = self.lerp(other, t); let _ = res.normalize_mut(); @@ -585,7 +585,7 @@ where /// ); /// assert_relative_eq!(dq.translation().vector.y, 3.0, epsilon = 1.0e-6); #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn sclerp(&self, other: &Self, t: T) -> Self where T: RealField, @@ -605,7 +605,7 @@ where /// * `epsilon`: the value below which the sinus of the angle separating both quaternion /// must be to return `None`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn try_sclerp(&self, other: &Self, t: T, epsilon: T) -> Option where T: RealField, @@ -673,7 +673,7 @@ where /// ); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn rotation(&self) -> UnitQuaternion { Unit::new_unchecked(self.as_ref().real) } @@ -693,7 +693,7 @@ where /// ); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn translation(&self) -> Translation3 { let two = T::one() + T::one(); Translation3::from( @@ -720,7 +720,7 @@ where /// assert_relative_eq!(iso.translation.vector, translation, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn to_isometry(&self) -> Isometry3 { Isometry3::from_parts(self.translation(), self.rotation()) } @@ -744,7 +744,7 @@ where /// ); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn transform_point(&self, pt: &Point3) -> Point3 { self * pt } @@ -768,7 +768,7 @@ where /// ); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn transform_vector(&self, v: &Vector3) -> Vector3 { self * v } @@ -792,7 +792,7 @@ where /// ); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse_transform_point(&self, pt: &Point3) -> Point3 { self.inverse() * pt } @@ -817,7 +817,7 @@ where /// ); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse_transform_vector(&self, v: &Vector3) -> Vector3 { self.inverse() * v } @@ -843,7 +843,7 @@ where /// ); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse_transform_unit_vector(&self, v: &Unit>) -> Unit> { self.inverse() * v } @@ -871,7 +871,7 @@ where /// assert_relative_eq!(dq.to_homogeneous(), expected, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn to_homogeneous(&self) -> Matrix4 { self.to_isometry().to_homogeneous() } diff --git a/src/geometry/isometry.rs b/src/geometry/isometry.rs index 19e2ed52..6d3e9127 100755 --- a/src/geometry/isometry.rs +++ b/src/geometry/isometry.rs @@ -267,7 +267,7 @@ where /// assert_eq!(iso1.inverse() * iso2, iso1.inv_mul(&iso2)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inv_mul(&self, rhs: &Isometry) -> Self { let inv_rot1 = self.rotation.inverse(); let tr_12 = rhs.translation.vector.clone() - self.translation.vector.clone(); @@ -385,7 +385,7 @@ where /// assert_relative_eq!(transformed_point, Point3::new(3.0, 2.0, 2.0), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn transform_point(&self, pt: &Point) -> Point { self * pt } @@ -409,7 +409,7 @@ where /// assert_relative_eq!(transformed_point, Vector3::new(3.0, 2.0, -1.0), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn transform_vector(&self, v: &SVector) -> SVector { self * v } @@ -432,7 +432,7 @@ where /// assert_relative_eq!(transformed_point, Point3::new(0.0, 2.0, 1.0), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse_transform_point(&self, pt: &Point) -> Point { self.rotation .inverse_transform_point(&(pt - &self.translation.vector)) @@ -457,7 +457,7 @@ where /// assert_relative_eq!(transformed_point, Vector3::new(-3.0, 2.0, 1.0), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse_transform_vector(&self, v: &SVector) -> SVector { self.rotation.inverse_transform_vector(v) } @@ -481,7 +481,7 @@ where /// assert_relative_eq!(transformed_point, -Vector3::y_axis(), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse_transform_unit_vector(&self, v: &Unit>) -> Unit> { self.rotation.inverse_transform_unit_vector(v) } @@ -511,7 +511,7 @@ impl Isometry { /// assert_relative_eq!(iso.to_homogeneous(), expected, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn to_homogeneous(&self) -> OMatrix, U1>, DimNameSum, U1>> where Const: DimNameAdd, @@ -543,7 +543,7 @@ impl Isometry { /// assert_relative_eq!(iso.to_matrix(), expected, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn to_matrix(&self) -> OMatrix, U1>, DimNameSum, U1>> where Const: DimNameAdd, diff --git a/src/geometry/isometry_interpolation.rs b/src/geometry/isometry_interpolation.rs index 1133ae26..356dbdad 100644 --- a/src/geometry/isometry_interpolation.rs +++ b/src/geometry/isometry_interpolation.rs @@ -26,7 +26,7 @@ impl Isometry3 { /// assert_eq!(iso3.rotation.euler_angles(), (std::f32::consts::FRAC_PI_2, 0.0, 0.0)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn lerp_slerp(&self, other: &Self, t: T) -> Self where T: RealField, @@ -60,7 +60,7 @@ impl Isometry3 { /// assert_eq!(iso3.rotation.euler_angles(), (std::f32::consts::FRAC_PI_2, 0.0, 0.0)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn try_lerp_slerp(&self, other: &Self, t: T, epsilon: T) -> Option where T: RealField, @@ -96,7 +96,7 @@ impl IsometryMatrix3 { /// assert_eq!(iso3.rotation.euler_angles(), (std::f32::consts::FRAC_PI_2, 0.0, 0.0)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn lerp_slerp(&self, other: &Self, t: T) -> Self where T: RealField, @@ -130,7 +130,7 @@ impl IsometryMatrix3 { /// assert_eq!(iso3.rotation.euler_angles(), (std::f32::consts::FRAC_PI_2, 0.0, 0.0)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn try_lerp_slerp(&self, other: &Self, t: T, epsilon: T) -> Option where T: RealField, @@ -167,7 +167,7 @@ impl Isometry2 { /// assert_relative_eq!(iso3.rotation.angle(), std::f32::consts::FRAC_PI_2); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn lerp_slerp(&self, other: &Self, t: T) -> Self where T: RealField, @@ -204,7 +204,7 @@ impl IsometryMatrix2 { /// assert_relative_eq!(iso3.rotation.angle(), std::f32::consts::FRAC_PI_2); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn lerp_slerp(&self, other: &Self, t: T) -> Self where T: RealField, diff --git a/src/geometry/orthographic.rs b/src/geometry/orthographic.rs index 1a02ebc8..6cc4dacc 100644 --- a/src/geometry/orthographic.rs +++ b/src/geometry/orthographic.rs @@ -188,7 +188,7 @@ impl Orthographic3 { /// assert_relative_eq!(proj.as_matrix() * inv, Matrix4::identity()); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse(&self) -> Matrix4 { let mut res = self.to_homogeneous(); @@ -222,7 +222,7 @@ impl Orthographic3 { /// assert_eq!(proj.to_homogeneous(), expected); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn to_homogeneous(&self) -> Matrix4 { self.matrix } @@ -242,7 +242,7 @@ impl Orthographic3 { /// assert_eq!(*proj.as_matrix(), expected); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn as_matrix(&self) -> &Matrix4 { &self.matrix } @@ -256,7 +256,7 @@ impl Orthographic3 { /// assert_eq!(proj.as_projective().to_homogeneous(), proj.to_homogeneous()); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn as_projective(&self) -> &Projective3 { unsafe { mem::transmute(self) } } @@ -270,7 +270,7 @@ impl Orthographic3 { /// assert_eq!(proj.to_projective().to_homogeneous(), proj.to_homogeneous()); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn to_projective(&self) -> Projective3 { Projective3::from_matrix_unchecked(self.matrix) } @@ -315,7 +315,7 @@ impl Orthographic3 { /// assert_relative_eq!(proj.left(), 10.0, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn left(&self) -> T { (-T::one() - self.matrix[(0, 3)]) / self.matrix[(0, 0)] } @@ -332,7 +332,7 @@ impl Orthographic3 { /// assert_relative_eq!(proj.right(), 1.0, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn right(&self) -> T { (T::one() - self.matrix[(0, 3)]) / self.matrix[(0, 0)] } @@ -349,7 +349,7 @@ impl Orthographic3 { /// assert_relative_eq!(proj.bottom(), 20.0, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn bottom(&self) -> T { (-T::one() - self.matrix[(1, 3)]) / self.matrix[(1, 1)] } @@ -366,7 +366,7 @@ impl Orthographic3 { /// assert_relative_eq!(proj.top(), 2.0, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn top(&self) -> T { (T::one() - self.matrix[(1, 3)]) / self.matrix[(1, 1)] } @@ -383,7 +383,7 @@ impl Orthographic3 { /// assert_relative_eq!(proj.znear(), 1000.0, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn znear(&self) -> T { (T::one() + self.matrix[(2, 3)]) / self.matrix[(2, 2)] } @@ -400,7 +400,7 @@ impl Orthographic3 { /// assert_relative_eq!(proj.zfar(), 0.1, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn zfar(&self) -> T { (-T::one() + self.matrix[(2, 3)]) / self.matrix[(2, 2)] } @@ -433,7 +433,7 @@ impl Orthographic3 { /// assert_relative_eq!(proj.project_point(&p8), Point3::new( 1.0, 1.0, 1.0)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn project_point(&self, p: &Point3) -> Point3 { Point3::new( self.matrix[(0, 0)] * p[0] + self.matrix[(0, 3)], @@ -469,7 +469,7 @@ impl Orthographic3 { /// assert_relative_eq!(proj.unproject_point(&p8), Point3::new(10.0, 20.0, -1000.0), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn unproject_point(&self, p: &Point3) -> Point3 { Point3::new( (p[0] - self.matrix[(0, 3)]) / self.matrix[(0, 0)], @@ -498,7 +498,7 @@ impl Orthographic3 { /// assert_relative_eq!(proj.project_vector(&v3), Vector3::z() * -2.0 / 999.9); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn project_vector(&self, p: &Vector) -> Vector3 where SB: Storage, diff --git a/src/geometry/perspective.rs b/src/geometry/perspective.rs index c300b292..65aee5fd 100644 --- a/src/geometry/perspective.rs +++ b/src/geometry/perspective.rs @@ -104,7 +104,7 @@ impl Perspective3 { /// Retrieves the inverse of the underlying homogeneous matrix. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse(&self) -> Matrix4 { let mut res = self.to_homogeneous(); @@ -124,28 +124,28 @@ impl Perspective3 { /// Computes the corresponding homogeneous matrix. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn to_homogeneous(&self) -> Matrix4 { self.matrix.clone_owned() } /// A reference to the underlying homogeneous transformation matrix. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn as_matrix(&self) -> &Matrix4 { &self.matrix } /// A reference to this transformation seen as a `Projective3`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn as_projective(&self) -> &Projective3 { unsafe { mem::transmute(self) } } /// This transformation seen as a `Projective3`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn to_projective(&self) -> Projective3 { Projective3::from_matrix_unchecked(self.matrix) } @@ -166,21 +166,21 @@ impl Perspective3 { /// Gets the `width / height` aspect ratio of the view frustum. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn aspect(&self) -> T { self.matrix[(1, 1)] / self.matrix[(0, 0)] } /// Gets the y field of view of the view frustum. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn fovy(&self) -> T { (T::one() / self.matrix[(1, 1)]).atan() * crate::convert(2.0) } /// Gets the near plane offset of the view frustum. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn znear(&self) -> T { let ratio = (-self.matrix[(2, 2)] + T::one()) / (-self.matrix[(2, 2)] - T::one()); @@ -190,7 +190,7 @@ impl Perspective3 { /// Gets the far plane offset of the view frustum. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn zfar(&self) -> T { let ratio = (-self.matrix[(2, 2)] + T::one()) / (-self.matrix[(2, 2)] - T::one()); @@ -202,7 +202,7 @@ impl Perspective3 { // TODO: when we get specialization, specialize the Mul impl instead. /// Projects a point. Faster than matrix multiplication. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn project_point(&self, p: &Point3) -> Point3 { let inverse_denom = -T::one() / p[2]; Point3::new( @@ -214,7 +214,7 @@ impl Perspective3 { /// Un-projects a point. Faster than multiplication by the matrix inverse. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn unproject_point(&self, p: &Point3) -> Point3 { let inverse_denom = self.matrix[(2, 3)] / (p[2] + self.matrix[(2, 2)]); @@ -228,7 +228,7 @@ impl Perspective3 { // TODO: when we get specialization, specialize the Mul impl instead. /// Projects a vector. Faster than matrix multiplication. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn project_vector(&self, p: &Vector) -> Vector3 where SB: Storage, diff --git a/src/geometry/point.rs b/src/geometry/point.rs index 8a9bb040..89db12cc 100644 --- a/src/geometry/point.rs +++ b/src/geometry/point.rs @@ -122,7 +122,7 @@ impl Point { /// assert_eq!(p.map(|e| e as u32), Point3::new(1, 2, 3)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn map T2>(&self, f: F) -> Point { self.coords.map(f).into() } @@ -162,7 +162,7 @@ impl Point { /// assert_eq!(p.to_homogeneous(), Vector4::new(10.0, 20.0, 30.0, 1.0)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn to_homogeneous(&self) -> OVector, U1>> where T: One, @@ -201,7 +201,7 @@ impl Point { /// assert_eq!(p.len(), 3); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn len(&self) -> usize { self.coords.len() } @@ -215,7 +215,7 @@ impl Point { /// assert!(!p.is_empty()); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn is_empty(&self) -> bool { self.len() == 0 } @@ -250,7 +250,7 @@ impl Point { /// Gets a reference to i-th element of this point without bound-checking. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub unsafe fn get_unchecked(&self, i: usize) -> &T { self.coords.vget_unchecked(i) } @@ -383,21 +383,21 @@ impl PartialOrd for Point { impl Point { /// Computes the infimum (aka. componentwise min) of two points. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inf(&self, other: &Self) -> Point { self.coords.inf(&other.coords).into() } /// Computes the supremum (aka. componentwise max) of two points. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn sup(&self, other: &Self) -> Point { self.coords.sup(&other.coords).into() } /// Computes the (infimum, supremum) of two points. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inf_sup(&self, other: &Self) -> (Point, Point) { let (inf, sup) = self.coords.inf_sup(&other.coords); (inf.into(), sup.into()) diff --git a/src/geometry/quaternion.rs b/src/geometry/quaternion.rs index 79bca5ac..79fda90a 100755 --- a/src/geometry/quaternion.rs +++ b/src/geometry/quaternion.rs @@ -191,7 +191,7 @@ where /// The imaginary part of this quaternion. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn imag(&self) -> Vector3 { self.coords.xyz() } @@ -224,7 +224,7 @@ where /// assert_eq!(q1.lerp(&q2, 0.1), Quaternion::new(1.9, 3.8, 5.7, 7.6)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn lerp(&self, other: &Self, t: T) -> Self { self * (T::one() - t) + other * t } @@ -240,7 +240,7 @@ where /// assert_eq!(q.vector()[2], 4.0); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn vector(&self) -> MatrixSlice, CStride> { self.coords.fixed_rows::<3>(0) } @@ -254,7 +254,7 @@ where /// assert_eq!(q.scalar(), 1.0); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn scalar(&self) -> T { self.coords[3] } @@ -270,7 +270,7 @@ where /// assert_eq!(*q.as_vector(), Vector4::new(2.0, 3.0, 4.0, 1.0)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn as_vector(&self) -> &Vector4 { &self.coords } @@ -285,7 +285,7 @@ where /// assert_relative_eq!(q.norm(), 5.47722557, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn norm(&self) -> T { self.coords.norm() } @@ -303,7 +303,7 @@ where /// assert_relative_eq!(q.magnitude(), 5.47722557, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn magnitude(&self) -> T { self.norm() } @@ -317,7 +317,7 @@ where /// assert_eq!(q.magnitude_squared(), 30.0); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn norm_squared(&self) -> T { self.coords.norm_squared() } @@ -334,7 +334,7 @@ where /// assert_eq!(q.magnitude_squared(), 30.0); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn magnitude_squared(&self) -> T { self.norm_squared() } @@ -349,7 +349,7 @@ where /// assert_eq!(q1.dot(&q2), 70.0); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn dot(&self, rhs: &Self) -> T { self.coords.dot(&rhs.coords) } @@ -419,7 +419,7 @@ where /// let result = a.inner(&b); /// assert_relative_eq!(expected, result, epsilon = 1.0e-5); #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inner(&self, other: &Self) -> Self { (self * other + other * self).half() } @@ -439,7 +439,7 @@ where /// assert_relative_eq!(expected, result, epsilon = 1.0e-5); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn outer(&self, other: &Self) -> Self { #[allow(clippy::eq_op)] (self * other - other * self).half() @@ -460,7 +460,7 @@ where /// assert_relative_eq!(expected, result, epsilon = 1.0e-5); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn project(&self, other: &Self) -> Option where T: RealField, @@ -483,7 +483,7 @@ where /// assert_relative_eq!(expected, result, epsilon = 1.0e-5); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn reject(&self, other: &Self) -> Option where T: RealField, @@ -506,7 +506,7 @@ where /// assert_eq!(half_ang, f32::consts::FRAC_PI_2); /// assert_eq!(axis, Some(Vector3::x_axis())); /// ``` - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn polar_decomposition(&self) -> (T, T, Option>>) where T: RealField, @@ -534,7 +534,7 @@ where /// assert_relative_eq!(q.ln(), Quaternion::new(1.683647, 1.190289, 0.0, 0.0), epsilon = 1.0e-6) /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn ln(&self) -> Self { let n = self.norm(); let v = self.vector(); @@ -553,7 +553,7 @@ where /// assert_relative_eq!(q.exp(), Quaternion::new(2.0, 5.0, 0.0, 0.0), epsilon = 1.0e-5) /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn exp(&self) -> Self { self.exp_eps(T::simd_default_epsilon()) } @@ -573,7 +573,7 @@ where /// assert_eq!(q.exp_eps(1.0e-6), Quaternion::identity()); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn exp_eps(&self, eps: T) -> Self { let v = self.vector(); let nn = v.norm_squared(); @@ -597,7 +597,7 @@ where /// assert_relative_eq!(q.powf(1.5), Quaternion::new( -6.2576659, 4.1549037, 6.2323556, 8.3098075), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn powf(&self, n: T) -> Self { (self.ln() * n).exp() } @@ -693,21 +693,21 @@ where /// Calculates square of a quaternion. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn squared(&self) -> Self { self * self } /// Divides quaternion into two. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn half(&self) -> Self { self / crate::convert(2.0f64) } /// Calculates square root. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn sqrt(&self) -> Self { self.powf(crate::convert(0.5)) } @@ -716,14 +716,14 @@ where /// /// A quaternion is pure if it has no real part (`self.w == 0.0`). #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn is_pure(&self) -> bool { self.w.is_zero() } /// Convert quaternion to pure quaternion. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn pure(&self) -> Self { Self::from_imag(self.imag()) } @@ -732,7 +732,7 @@ where /// /// Calculates B-1 * A where A = self, B = other. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn left_div(&self, other: &Self) -> Option where T: RealField, @@ -755,7 +755,7 @@ where /// assert_relative_eq!(expected, result, epsilon = 1.0e-7); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn right_div(&self, other: &Self) -> Option where T: RealField, @@ -775,7 +775,7 @@ where /// assert_relative_eq!(expected, result, epsilon = 1.0e-7); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn cos(&self) -> Self { let z = self.imag().magnitude(); let w = -self.w.simd_sin() * z.simd_sinhc(); @@ -793,7 +793,7 @@ where /// assert_relative_eq!(input, result, epsilon = 1.0e-7); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn acos(&self) -> Self { let u = Self::from_imag(self.imag().normalize()); let identity = Self::identity(); @@ -815,7 +815,7 @@ where /// assert_relative_eq!(expected, result, epsilon = 1.0e-7); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn sin(&self) -> Self { let z = self.imag().magnitude(); let w = self.w.simd_cos() * z.simd_sinhc(); @@ -833,7 +833,7 @@ where /// assert_relative_eq!(input, result, epsilon = 1.0e-7); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn asin(&self) -> Self { let u = Self::from_imag(self.imag().normalize()); let identity = Self::identity(); @@ -855,7 +855,7 @@ where /// assert_relative_eq!(expected, result, epsilon = 1.0e-7); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn tan(&self) -> Self where T: RealField, @@ -874,7 +874,7 @@ where /// assert_relative_eq!(input, result, epsilon = 1.0e-7); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn atan(&self) -> Self where T: RealField, @@ -899,7 +899,7 @@ where /// assert_relative_eq!(expected, result, epsilon = 1.0e-7); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn sinh(&self) -> Self { (self.exp() - (-self).exp()).half() } @@ -916,7 +916,7 @@ where /// assert_relative_eq!(expected, result, epsilon = 1.0e-7); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn asinh(&self) -> Self { let identity = Self::identity(); (self + (identity + self.squared()).sqrt()).ln() @@ -934,7 +934,7 @@ where /// assert_relative_eq!(expected, result, epsilon = 1.0e-7); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn cosh(&self) -> Self { (self.exp() + (-self).exp()).half() } @@ -951,7 +951,7 @@ where /// assert_relative_eq!(expected, result, epsilon = 1.0e-7); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn acosh(&self) -> Self { let identity = Self::identity(); (self + (self + identity).sqrt() * (self - identity).sqrt()).ln() @@ -969,7 +969,7 @@ where /// assert_relative_eq!(expected, result, epsilon = 1.0e-7); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn tanh(&self) -> Self where T: RealField, @@ -989,7 +989,7 @@ where /// assert_relative_eq!(expected, result, epsilon = 1.0e-7); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn atanh(&self) -> Self { let identity = Self::identity(); ((identity + self).ln() - (identity - self).ln()).half() @@ -1107,7 +1107,7 @@ where /// assert_eq!(rot.angle(), 1.78); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn angle(&self) -> T { let w = self.quaternion().scalar().simd_abs(); self.quaternion().imag().norm().simd_atan2(w) * crate::convert(2.0f64) @@ -1124,7 +1124,7 @@ where /// assert_eq!(*axis.quaternion(), Quaternion::new(1.0, 0.0, 0.0, 0.0)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn quaternion(&self) -> &Quaternion { self.as_ref() } @@ -1173,7 +1173,7 @@ where /// assert_relative_eq!(rot1.angle_to(&rot2), 1.0045657, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn angle_to(&self, other: &Self) -> T { let delta = self.rotation_to(other); delta.angle() @@ -1193,7 +1193,7 @@ where /// assert_relative_eq!(rot_to * rot1, rot2, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn rotation_to(&self, other: &Self) -> Self { other / self } @@ -1210,7 +1210,7 @@ where /// assert_eq!(q1.lerp(&q2, 0.1), Quaternion::new(0.9, 0.1, 0.0, 0.0)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn lerp(&self, other: &Self, t: T) -> Quaternion { self.as_ref().lerp(other.as_ref(), t) } @@ -1227,7 +1227,7 @@ where /// assert_eq!(q1.nlerp(&q2, 0.1), UnitQuaternion::new_normalize(Quaternion::new(0.9, 0.1, 0.0, 0.0))); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn nlerp(&self, other: &Self, t: T) -> Self { let mut res = self.lerp(other, t); let _ = res.normalize_mut(); @@ -1253,7 +1253,7 @@ where /// assert_eq!(q.euler_angles(), (std::f32::consts::FRAC_PI_2, 0.0, 0.0)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn slerp(&self, other: &Self, t: T) -> Self where T: RealField, @@ -1273,7 +1273,7 @@ where /// * `epsilon`: the value below which the sinus of the angle separating both quaternion /// must be to return `None`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn try_slerp(&self, other: &Self, t: T, epsilon: T) -> Option where T: RealField, @@ -1333,7 +1333,7 @@ where /// assert!(rot.axis().is_none()); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn axis(&self) -> Option>> where T: RealField, @@ -1358,7 +1358,7 @@ where /// assert_relative_eq!(rot.scaled_axis(), axisangle, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn scaled_axis(&self) -> Vector3 where T: RealField, @@ -1387,7 +1387,7 @@ where /// assert!(rot.axis_angle().is_none()); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn axis_angle(&self) -> Option<(Unit>, T)> where T: RealField, @@ -1399,7 +1399,7 @@ where /// /// Note that this function yields a `Quaternion` because it loses the unit property. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn exp(&self) -> Quaternion { self.as_ref().exp() } @@ -1419,7 +1419,7 @@ where /// assert_relative_eq!(q.ln().vector().into_owned(), axisangle, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn ln(&self) -> Quaternion where T: RealField, @@ -1448,7 +1448,7 @@ where /// assert_eq!(pow.angle(), 2.4); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn powf(&self, n: T) -> Self where T: RealField, @@ -1477,7 +1477,7 @@ where /// assert_relative_eq!(*rot.matrix(), expected, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn to_rotation_matrix(&self) -> Rotation { let i = self.as_ref()[0]; let j = self.as_ref()[1]; @@ -1535,7 +1535,7 @@ where /// assert_relative_eq!(euler.2, 0.3, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn euler_angles(&self) -> (T, T, T) where T: RealField, @@ -1560,7 +1560,7 @@ where /// assert_relative_eq!(rot.to_homogeneous(), expected, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn to_homogeneous(&self) -> Matrix4 { self.to_rotation_matrix().to_homogeneous() } @@ -1581,7 +1581,7 @@ where /// assert_relative_eq!(transformed_point, Point3::new(3.0, 2.0, -1.0), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn transform_point(&self, pt: &Point3) -> Point3 { self * pt } @@ -1602,7 +1602,7 @@ where /// assert_relative_eq!(transformed_vector, Vector3::new(3.0, 2.0, -1.0), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn transform_vector(&self, v: &Vector3) -> Vector3 { self * v } @@ -1623,7 +1623,7 @@ where /// assert_relative_eq!(transformed_point, Point3::new(-3.0, 2.0, 1.0), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse_transform_point(&self, pt: &Point3) -> Point3 { // TODO: would it be useful performancewise not to call inverse explicitly (i-e. implement // the inverse transformation explicitly here) ? @@ -1646,7 +1646,7 @@ where /// assert_relative_eq!(transformed_vector, Vector3::new(-3.0, 2.0, 1.0), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse_transform_vector(&self, v: &Vector3) -> Vector3 { self.inverse() * v } @@ -1667,7 +1667,7 @@ where /// assert_relative_eq!(transformed_vector, -Vector3::y_axis(), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse_transform_unit_vector(&self, v: &Unit>) -> Unit> { self.inverse() * v } @@ -1676,7 +1676,7 @@ where /// /// This is faster, but approximate, way to compute `UnitQuaternion::new(axisangle) * self`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn append_axisangle_linearized(&self, axisangle: &Vector3) -> Self { let half: T = crate::convert(0.5); let q1 = self.into_inner(); diff --git a/src/geometry/reflection.rs b/src/geometry/reflection.rs index 7a34d972..dcc754c2 100644 --- a/src/geometry/reflection.rs +++ b/src/geometry/reflection.rs @@ -34,7 +34,7 @@ impl> Reflection { } /// The reflexion axis. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn axis(&self) -> &Vector { &self.axis } diff --git a/src/geometry/rotation.rs b/src/geometry/rotation.rs index 9950568d..f3127fb9 100755 --- a/src/geometry/rotation.rs +++ b/src/geometry/rotation.rs @@ -185,7 +185,7 @@ impl Rotation { /// assert_eq!(*rot.matrix(), expected); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn matrix(&self) -> &SMatrix { &self.matrix } @@ -263,7 +263,7 @@ impl Rotation { /// assert_eq!(rot.to_homogeneous(), expected); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn to_homogeneous(&self) -> OMatrix, U1>, DimNameSum, U1>> where T: Zero + One, @@ -405,7 +405,7 @@ where /// assert_relative_eq!(transformed_point, Point3::new(3.0, 2.0, -1.0), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn transform_point(&self, pt: &Point) -> Point { self * pt } @@ -425,7 +425,7 @@ where /// assert_relative_eq!(transformed_vector, Vector3::new(3.0, 2.0, -1.0), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn transform_vector(&self, v: &SVector) -> SVector { self * v } @@ -445,7 +445,7 @@ where /// assert_relative_eq!(transformed_point, Point3::new(-3.0, 2.0, 1.0), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse_transform_point(&self, pt: &Point) -> Point { Point::from(self.inverse_transform_vector(&pt.coords)) } @@ -465,7 +465,7 @@ where /// assert_relative_eq!(transformed_vector, Vector3::new(-3.0, 2.0, 1.0), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse_transform_vector(&self, v: &SVector) -> SVector { self.matrix().tr_mul(v) } @@ -485,7 +485,7 @@ where /// assert_relative_eq!(transformed_vector, -Vector3::y_axis(), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse_transform_unit_vector(&self, v: &Unit>) -> Unit> { Unit::new_unchecked(self.inverse_transform_vector(&**v)) } diff --git a/src/geometry/rotation_interpolation.rs b/src/geometry/rotation_interpolation.rs index 6c724b21..6b5a5c11 100644 --- a/src/geometry/rotation_interpolation.rs +++ b/src/geometry/rotation_interpolation.rs @@ -18,7 +18,7 @@ impl Rotation2 { /// assert_relative_eq!(rot.angle(), std::f32::consts::FRAC_PI_2); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn slerp(&self, other: &Self, t: T) -> Self where T::Element: SimdRealField, @@ -48,7 +48,7 @@ impl Rotation3 { /// assert_eq!(q.euler_angles(), (std::f32::consts::FRAC_PI_2, 0.0, 0.0)); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn slerp(&self, other: &Self, t: T) -> Self where T: RealField, @@ -69,7 +69,7 @@ impl Rotation3 { /// * `epsilon`: the value below which the sinus of the angle separating both rotations /// must be to return `None`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn try_slerp(&self, other: &Self, t: T, epsilon: T) -> Option where T: RealField, diff --git a/src/geometry/rotation_specialization.rs b/src/geometry/rotation_specialization.rs index 4000e239..a89f5845 100644 --- a/src/geometry/rotation_specialization.rs +++ b/src/geometry/rotation_specialization.rs @@ -186,7 +186,7 @@ impl Rotation2 { /// assert_relative_eq!(rot_to.inverse() * rot2, rot1); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn rotation_to(&self, other: &Self) -> Self { other * self.inverse() } @@ -216,7 +216,7 @@ impl Rotation2 { /// assert_relative_eq!(pow.angle(), 2.0 * 0.78); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn powf(&self, n: T) -> Self { Self::new(self.angle() * n) } @@ -234,7 +234,7 @@ impl Rotation2 { /// assert_relative_eq!(rot.angle(), 1.78); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn angle(&self) -> T { self.matrix()[(1, 0)].simd_atan2(self.matrix()[(0, 0)]) } @@ -250,7 +250,7 @@ impl Rotation2 { /// assert_relative_eq!(rot1.angle_to(&rot2), 1.6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn angle_to(&self, other: &Self) -> T { self.rotation_to(other).angle() } @@ -260,7 +260,7 @@ impl Rotation2 { /// This is generally used in the context of generic programming. Using /// the `.angle()` method instead is more common. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn scaled_axis(&self) -> SVector { Vector1::new(self.angle()) } @@ -645,7 +645,7 @@ where /// assert_relative_eq!(rot_to * rot1, rot2, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn rotation_to(&self, other: &Self) -> Self { other * self.inverse() } @@ -665,7 +665,7 @@ where /// assert_eq!(pow.angle(), 2.4); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn powf(&self, n: T) -> Self where T: RealField, @@ -772,7 +772,7 @@ impl Rotation3 { /// assert_relative_eq!(rot.angle(), 1.78); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn angle(&self) -> T { ((self.matrix()[(0, 0)] + self.matrix()[(1, 1)] + self.matrix()[(2, 2)] - T::one()) / crate::convert(2.0)) @@ -795,7 +795,7 @@ impl Rotation3 { /// assert!(rot.axis().is_none()); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn axis(&self) -> Option>> where T: RealField, @@ -820,7 +820,7 @@ impl Rotation3 { /// assert_relative_eq!(rot.scaled_axis(), axisangle, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn scaled_axis(&self) -> Vector3 where T: RealField, @@ -852,7 +852,7 @@ impl Rotation3 { /// assert!(rot.axis_angle().is_none()); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn axis_angle(&self) -> Option<(Unit>, T)> where T: RealField, @@ -875,7 +875,7 @@ impl Rotation3 { /// assert_relative_eq!(rot1.angle_to(&rot2), 1.0045657, epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn angle_to(&self, other: &Self) -> T where T::Element: SimdRealField, @@ -908,7 +908,7 @@ impl Rotation3 { /// assert_relative_eq!(euler.1, 0.2, epsilon = 1.0e-6); /// assert_relative_eq!(euler.2, 0.3, epsilon = 1.0e-6); /// ``` - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn euler_angles(&self) -> (T, T, T) where T: RealField, diff --git a/src/geometry/similarity.rs b/src/geometry/similarity.rs index 6a1fe095..516b95c5 100755 --- a/src/geometry/similarity.rs +++ b/src/geometry/similarity.rs @@ -122,7 +122,7 @@ where impl Similarity { /// The scaling factor of this similarity transformation. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn scaling(&self) -> T { self.scaling.inlined_clone() } @@ -249,7 +249,7 @@ where /// assert_relative_eq!(transformed_point, Point3::new(19.0, 17.0, -9.0), epsilon = 1.0e-5); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn transform_point(&self, pt: &Point) -> Point { self * pt } @@ -271,7 +271,7 @@ where /// assert_relative_eq!(transformed_vector, Vector3::new(18.0, 15.0, -12.0), epsilon = 1.0e-5); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn transform_vector(&self, v: &SVector) -> SVector { self * v } @@ -292,7 +292,7 @@ where /// assert_relative_eq!(transformed_point, Point3::new(-1.5, 1.5, 1.5), epsilon = 1.0e-5); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse_transform_point(&self, pt: &Point) -> Point { self.isometry.inverse_transform_point(pt) / self.scaling() } @@ -313,7 +313,7 @@ where /// assert_relative_eq!(transformed_vector, Vector3::new(-3.0, 2.5, 2.0), epsilon = 1.0e-5); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse_transform_vector(&self, v: &SVector) -> SVector { self.isometry.inverse_transform_vector(v) / self.scaling() } @@ -326,7 +326,7 @@ where impl Similarity { /// Converts this similarity into its equivalent homogeneous transformation matrix. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn to_homogeneous(&self) -> OMatrix, U1>, DimNameSum, U1>> where Const: DimNameAdd, diff --git a/src/geometry/swizzle.rs b/src/geometry/swizzle.rs index 74f423ff..0ad51f00 100644 --- a/src/geometry/swizzle.rs +++ b/src/geometry/swizzle.rs @@ -8,7 +8,7 @@ macro_rules! impl_swizzle { $( /// Builds a new point from components of `self`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn $name(&self) -> $Result where as ToTypenum>::Typenum: Cmp { $Result::new($(self[$i].inlined_clone()),*) diff --git a/src/geometry/transform.rs b/src/geometry/transform.rs index a62c5ede..8c294b15 100755 --- a/src/geometry/transform.rs +++ b/src/geometry/transform.rs @@ -301,7 +301,7 @@ where /// assert_eq!(*t.matrix(), m); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn matrix(&self) -> &OMatrix, U1>, DimNameSum, U1>> { &self.matrix } @@ -368,7 +368,7 @@ where /// assert_eq!(t.into_inner(), m); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn to_homogeneous(&self) -> OMatrix, U1>, DimNameSum, U1>> { self.matrix().clone_owned() } @@ -500,7 +500,7 @@ where /// /// This is the same as the multiplication `self * pt`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn transform_point(&self, pt: &Point) -> Point { self * pt } @@ -510,7 +510,7 @@ where /// /// This is the same as the multiplication `self * v`. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn transform_vector(&self, v: &SVector) -> SVector { self * v } @@ -528,7 +528,7 @@ where /// This may be cheaper than inverting the transformation and transforming /// the point. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse_transform_point(&self, pt: &Point) -> Point { self.clone().inverse() * pt } @@ -537,7 +537,7 @@ where /// This may be cheaper than inverting the transformation and transforming /// the vector. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse_transform_vector(&self, v: &SVector) -> SVector { self.clone().inverse() * v } diff --git a/src/geometry/translation.rs b/src/geometry/translation.rs index 98ee4636..1476e75b 100755 --- a/src/geometry/translation.rs +++ b/src/geometry/translation.rs @@ -190,7 +190,7 @@ impl Translation { /// assert_eq!(t.to_homogeneous(), expected); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn to_homogeneous(&self) -> OMatrix, U1>, DimNameSum, U1>> where T: Zero + One, @@ -242,7 +242,7 @@ impl Translation { /// let transformed_point = t.transform_point(&Point3::new(4.0, 5.0, 6.0)); /// assert_eq!(transformed_point, Point3::new(5.0, 7.0, 9.0)); #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn transform_point(&self, pt: &Point) -> Point { pt + &self.vector } @@ -258,7 +258,7 @@ impl Translation { /// let transformed_point = t.inverse_transform_point(&Point3::new(4.0, 5.0, 6.0)); /// assert_eq!(transformed_point, Point3::new(3.0, 3.0, 3.0)); #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse_transform_point(&self, pt: &Point) -> Point { pt - &self.vector } diff --git a/src/geometry/unit_complex.rs b/src/geometry/unit_complex.rs index 414ca425..be0c8980 100755 --- a/src/geometry/unit_complex.rs +++ b/src/geometry/unit_complex.rs @@ -84,7 +84,7 @@ where /// assert_eq!(rot.angle(), 1.78); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn angle(&self) -> T { self.im.simd_atan2(self.re) } @@ -99,7 +99,7 @@ where /// assert_eq!(rot.sin_angle(), angle.sin()); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn sin_angle(&self) -> T { self.im } @@ -114,7 +114,7 @@ where /// assert_eq!(rot.cos_angle(),angle.cos()); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn cos_angle(&self) -> T { self.re } @@ -124,7 +124,7 @@ where /// This is generally used in the context of generic programming. Using /// the `.angle()` method instead is more common. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn scaled_axis(&self) -> Vector1 { Vector1::new(self.angle()) } @@ -135,7 +135,7 @@ where /// the `.angle()` method instead is more common. /// Returns `None` if the angle is zero. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn axis_angle(&self) -> Option<(Unit>, T)> where T: RealField, @@ -162,7 +162,7 @@ where /// assert_relative_eq!(rot1.angle_to(&rot2), 1.6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn angle_to(&self, other: &Self) -> T { let delta = self.rotation_to(other); delta.angle() @@ -260,7 +260,7 @@ where /// assert_eq!(rot.to_rotation_matrix(), expected); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn to_rotation_matrix(&self) -> Rotation2 { let r = self.re; let i = self.im; @@ -281,7 +281,7 @@ where /// assert_eq!(rot.to_homogeneous(), expected); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn to_homogeneous(&self) -> Matrix3 { self.to_rotation_matrix().to_homogeneous() } @@ -306,7 +306,7 @@ where /// assert_relative_eq!(transformed_point, Point2::new(-2.0, 1.0), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn transform_point(&self, pt: &Point2) -> Point2 { self * pt } @@ -325,7 +325,7 @@ where /// assert_relative_eq!(transformed_vector, Vector2::new(-2.0, 1.0), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn transform_vector(&self, v: &Vector2) -> Vector2 { self * v } @@ -342,7 +342,7 @@ where /// assert_relative_eq!(transformed_point, Point2::new(2.0, -1.0), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse_transform_point(&self, pt: &Point2) -> Point2 { // TODO: would it be useful performancewise not to call inverse explicitly (i-e. implement // the inverse transformation explicitly here) ? @@ -361,7 +361,7 @@ where /// assert_relative_eq!(transformed_vector, Vector2::new(2.0, -1.0), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse_transform_vector(&self, v: &Vector2) -> Vector2 { self.inverse() * v } @@ -378,7 +378,7 @@ where /// assert_relative_eq!(transformed_vector, -Vector2::y_axis(), epsilon = 1.0e-6); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn inverse_transform_unit_vector(&self, v: &Unit>) -> Unit> { self.inverse() * v } @@ -405,7 +405,7 @@ where /// assert_relative_eq!(rot.angle(), std::f32::consts::FRAC_PI_2); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn slerp(&self, other: &Self, t: T) -> Self { Self::new(self.angle() * (T::one() - t) + other.angle() * t) } diff --git a/src/geometry/unit_complex_construction.rs b/src/geometry/unit_complex_construction.rs index 6a3ad6de..16e605f2 100644 --- a/src/geometry/unit_complex_construction.rs +++ b/src/geometry/unit_complex_construction.rs @@ -148,7 +148,7 @@ where /// assert_eq!(*rot.complex(), Complex::new(angle.cos(), angle.sin())); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn complex(&self) -> &Complex { self.as_ref() } @@ -245,7 +245,7 @@ where /// assert_relative_eq!(rot_to.inverse() * rot2, rot1); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn rotation_to(&self, other: &Self) -> Self { other / self } @@ -264,7 +264,7 @@ where /// assert_relative_eq!(pow.angle(), 2.0 * 0.78); /// ``` #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn powf(&self, n: T) -> Self { Self::from_angle(self.angle() * n) } diff --git a/src/linalg/bidiagonal.rs b/src/linalg/bidiagonal.rs index d8997196..6a462988 100644 --- a/src/linalg/bidiagonal.rs +++ b/src/linalg/bidiagonal.rs @@ -153,7 +153,7 @@ where /// Indicates whether this decomposition contains an upper-diagonal matrix. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn is_upper_diagonal(&self) -> bool { self.upper_diagonal } @@ -189,7 +189,7 @@ where /// Retrieves the upper trapezoidal submatrix `R` of this decomposition. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn d(&self) -> OMatrix, DimMinimum> where DefaultAllocator: Allocator, DimMinimum>, @@ -209,7 +209,7 @@ where /// Computes the orthogonal matrix `U` of this `U * D * V` decomposition. // TODO: code duplication with householder::assemble_q. // Except that we are returning a rectangular matrix here. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn u(&self) -> OMatrix> where DefaultAllocator: Allocator>, @@ -240,7 +240,7 @@ where } /// Computes the orthogonal matrix `V_t` of this `U * D * V_t` decomposition. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn v_t(&self) -> OMatrix, C> where DefaultAllocator: Allocator, C>, @@ -278,7 +278,7 @@ where } /// The diagonal part of this decomposed matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn diagonal(&self) -> OVector> where DefaultAllocator: Allocator>, @@ -287,7 +287,7 @@ where } /// The off-diagonal part of this decomposed matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn off_diagonal(&self) -> OVector, U1>> where DefaultAllocator: Allocator, U1>>, diff --git a/src/linalg/cholesky.rs b/src/linalg/cholesky.rs index 60f1f0f5..1e352560 100644 --- a/src/linalg/cholesky.rs +++ b/src/linalg/cholesky.rs @@ -92,7 +92,7 @@ where /// Retrieves the lower-triangular factor of the Cholesky decomposition with its strictly /// uppen-triangular part filled with zeros. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn l(&self) -> OMatrix { self.chol.lower_triangle() } @@ -102,7 +102,7 @@ where /// /// This is an allocation-less version of `self.l()`. The values of the strict upper-triangular /// part are garbage and should be ignored by further computations. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn l_dirty(&self) -> &OMatrix { &self.chol } @@ -144,7 +144,7 @@ where } /// Computes the determinant of the decomposed matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn determinant(&self) -> T::SimdRealField { let dim = self.chol.nrows(); let mut prod_diag = T::one(); @@ -292,7 +292,7 @@ where /// Updates the decomposition such that we get the decomposition of the factored matrix with its `j`th column removed. /// Since the matrix is square, the `j`th row will also be removed. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn remove_column(&self, j: usize) -> Cholesky> where D: DimSub, diff --git a/src/linalg/col_piv_qr.rs b/src/linalg/col_piv_qr.rs index e48263fd..1a56d2cb 100644 --- a/src/linalg/col_piv_qr.rs +++ b/src/linalg/col_piv_qr.rs @@ -95,7 +95,7 @@ where /// Retrieves the upper trapezoidal submatrix `R` of this decomposition. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn r(&self) -> OMatrix, C> where DefaultAllocator: Allocator, C>, @@ -127,7 +127,7 @@ where } /// Computes the orthogonal matrix `Q` of this decomposition. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn q(&self) -> OMatrix> where DefaultAllocator: Allocator>, @@ -152,7 +152,7 @@ where } /// Retrieves the column permutation of this decomposition. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn p(&self) -> &PermutationSequence> { &self.p } @@ -287,7 +287,7 @@ where /// Computes the inverse of the decomposed matrix. /// /// Returns `None` if the decomposed matrix is not invertible. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn try_inverse(&self) -> Option> { assert!( self.col_piv_qr.is_square(), @@ -306,7 +306,7 @@ where } /// Indicates if the decomposed matrix is invertible. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn is_invertible(&self) -> bool { assert!( self.col_piv_qr.is_square(), @@ -323,7 +323,7 @@ where } /// Computes the determinant of the decomposed matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn determinant(&self) -> T { let dim = self.col_piv_qr.nrows(); assert!( diff --git a/src/linalg/convolution.rs b/src/linalg/convolution.rs index 075b3508..36cea3a0 100644 --- a/src/linalg/convolution.rs +++ b/src/linalg/convolution.rs @@ -112,7 +112,7 @@ impl> Vector { /// /// # Errors /// Inputs must satisfy `self.len() >= kernel.len() > 0`. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn convolve_same(&self, kernel: Vector) -> OVector where D2: Dim, diff --git a/src/linalg/determinant.rs b/src/linalg/determinant.rs index 43478261..22b681f5 100644 --- a/src/linalg/determinant.rs +++ b/src/linalg/determinant.rs @@ -12,7 +12,7 @@ impl, S: Storage> SquareMatri /// /// If the matrix has a dimension larger than 3, an LU decomposition is used. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn determinant(&self) -> T where DefaultAllocator: Allocator + Allocator<(usize, usize), D>, diff --git a/src/linalg/full_piv_lu.rs b/src/linalg/full_piv_lu.rs index 9ce6c24d..f08af55c 100644 --- a/src/linalg/full_piv_lu.rs +++ b/src/linalg/full_piv_lu.rs @@ -96,7 +96,7 @@ where /// The lower triangular matrix of this decomposition. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn l(&self) -> OMatrix> where DefaultAllocator: Allocator>, @@ -110,7 +110,7 @@ where /// The upper triangular matrix of this decomposition. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn u(&self) -> OMatrix, C> where DefaultAllocator: Allocator, C>, @@ -121,14 +121,14 @@ where /// The row permutations of this decomposition. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn p(&self) -> &PermutationSequence> { &self.p } /// The column permutations of this decomposition. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn q(&self) -> &PermutationSequence> { &self.q } @@ -215,7 +215,7 @@ where /// Computes the inverse of the decomposed matrix. /// /// Returns `None` if the decomposed matrix is not invertible. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn try_inverse(&self) -> Option> { assert!( self.lu.is_square(), @@ -233,7 +233,7 @@ where } /// Indicates if the decomposed matrix is invertible. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn is_invertible(&self) -> bool { assert!( self.lu.is_square(), @@ -245,7 +245,7 @@ where } /// Computes the determinant of the decomposed matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn determinant(&self) -> T { assert!( self.lu.is_square(), diff --git a/src/linalg/givens.rs b/src/linalg/givens.rs index e555cbfb..8be91fe1 100644 --- a/src/linalg/givens.rs +++ b/src/linalg/givens.rs @@ -89,13 +89,13 @@ impl GivensRotation { } /// The cos part of this roration. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn c(&self) -> T::RealField { self.c } /// The sin part of this roration. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn s(&self) -> T { self.s } diff --git a/src/linalg/hessenberg.rs b/src/linalg/hessenberg.rs index e6201685..6b8ecfee 100644 --- a/src/linalg/hessenberg.rs +++ b/src/linalg/hessenberg.rs @@ -116,7 +116,7 @@ where /// /// This is less efficient than `.unpack_h()` as it allocates a new matrix. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn h(&self) -> OMatrix { let dim = self.hess.nrows(); let mut res = self.hess.clone(); @@ -127,7 +127,7 @@ where } /// Computes the orthogonal matrix `Q` of this decomposition. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn q(&self) -> OMatrix { householder::assemble_q(&self.hess, self.subdiag.as_slice()) } diff --git a/src/linalg/lu.rs b/src/linalg/lu.rs index 0c5dfe15..36a00807 100644 --- a/src/linalg/lu.rs +++ b/src/linalg/lu.rs @@ -127,7 +127,7 @@ where /// The lower triangular matrix of this decomposition. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn l(&self) -> OMatrix> where DefaultAllocator: Allocator>, @@ -171,7 +171,7 @@ where /// The upper triangular matrix of this decomposition. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn u(&self) -> OMatrix, C> where DefaultAllocator: Allocator, C>, @@ -182,7 +182,7 @@ where /// The row permutations of this decomposition. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn p(&self) -> &PermutationSequence> { &self.p } @@ -261,7 +261,7 @@ where /// Computes the inverse of the decomposed matrix. /// /// Returns `None` if the matrix is not invertible. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn try_inverse(&self) -> Option> { assert!( self.lu.is_square(), @@ -296,7 +296,7 @@ where } /// Computes the determinant of the decomposed matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn determinant(&self) -> T { let dim = self.lu.nrows(); assert!( @@ -313,7 +313,7 @@ where } /// Indicates if the decomposed matrix is invertible. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn is_invertible(&self) -> bool { assert!( self.lu.is_square(), diff --git a/src/linalg/permutation_sequence.rs b/src/linalg/permutation_sequence.rs index a852f0c9..ea868b5a 100644 --- a/src/linalg/permutation_sequence.rs +++ b/src/linalg/permutation_sequence.rs @@ -140,20 +140,20 @@ where } /// The number of non-identity permutations applied by this sequence. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn len(&self) -> usize { self.len } /// Returns true if the permutation sequence contains no elements. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn is_empty(&self) -> bool { self.len() == 0 } /// The determinant of the matrix corresponding to this permutation. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn determinant(&self) -> T { if self.len % 2 == 0 { T::one() diff --git a/src/linalg/qr.rs b/src/linalg/qr.rs index 2fa308ff..4bdbb364 100644 --- a/src/linalg/qr.rs +++ b/src/linalg/qr.rs @@ -70,7 +70,7 @@ where /// Retrieves the upper trapezoidal submatrix `R` of this decomposition. #[inline] - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn r(&self) -> OMatrix, C> where DefaultAllocator: Allocator, C>, @@ -97,7 +97,7 @@ where } /// Computes the orthogonal matrix `Q` of this decomposition. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn q(&self) -> OMatrix> where DefaultAllocator: Allocator>, @@ -246,7 +246,7 @@ where /// Computes the inverse of the decomposed matrix. /// /// Returns `None` if the decomposed matrix is not invertible. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn try_inverse(&self) -> Option> { assert!( self.qr.is_square(), @@ -265,7 +265,7 @@ where } /// Indicates if the decomposed matrix is invertible. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn is_invertible(&self) -> bool { assert!( self.qr.is_square(), diff --git a/src/linalg/schur.rs b/src/linalg/schur.rs index 4f9271f7..16b8c66d 100644 --- a/src/linalg/schur.rs +++ b/src/linalg/schur.rs @@ -385,7 +385,7 @@ where /// Computes the real eigenvalues of the decomposed matrix. /// /// Return `None` if some eigenvalues are complex. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn eigenvalues(&self) -> Option> { let mut out = unsafe { crate::unimplemented_or_uninitialized_generic!(self.t.data.shape().0, Const::<1>) @@ -398,7 +398,7 @@ where } /// Computes the complex eigenvalues of the decomposed matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn complex_eigenvalues(&self) -> OVector, D> where T: RealField, @@ -511,7 +511,7 @@ where + Allocator, { /// Computes the eigenvalues of this matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn eigenvalues(&self) -> Option> { assert!( self.is_square(), @@ -554,7 +554,7 @@ where } /// Computes the eigenvalues of this matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn complex_eigenvalues(&self) -> OVector, D> // TODO: add balancing? where diff --git a/src/linalg/svd.rs b/src/linalg/svd.rs index b579eb54..f559c9fa 100644 --- a/src/linalg/svd.rs +++ b/src/linalg/svd.rs @@ -502,7 +502,7 @@ where /// Computes the rank of the decomposed matrix, i.e., the number of singular values greater /// than `eps`. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn rank(&self, eps: T::RealField) -> usize { assert!( eps >= T::RealField::zero(), @@ -616,7 +616,7 @@ where + Allocator, U1>>, { /// Computes the singular values of this matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn singular_values(&self) -> OVector> { SVD::new(self.clone_owned(), false, false).singular_values } @@ -624,7 +624,7 @@ where /// Computes the rank of this matrix. /// /// All singular values below `eps` are considered equal to 0. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn rank(&self, eps: T::RealField) -> usize { let svd = SVD::new(self.clone_owned(), false, false); svd.rank(eps) diff --git a/src/linalg/symmetric_eigen.rs b/src/linalg/symmetric_eigen.rs index d0409e95..25dab08c 100644 --- a/src/linalg/symmetric_eigen.rs +++ b/src/linalg/symmetric_eigen.rs @@ -268,7 +268,7 @@ where /// Rebuild the original matrix. /// /// This is useful if some of the eigenvalues have been manually modified. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn recompose(&self) -> OMatrix { let mut u_t = self.eigenvectors.clone(); for i in 0..self.eigenvalues.len() { @@ -312,7 +312,7 @@ where /// Computes the eigenvalues of this symmetric matrix. /// /// Only the lower-triangular part of the matrix is read. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn symmetric_eigenvalues(&self) -> OVector { SymmetricEigen::do_decompose( self.clone_owned(), diff --git a/src/linalg/symmetric_tridiagonal.rs b/src/linalg/symmetric_tridiagonal.rs index 82a2433b..c7e87ba8 100644 --- a/src/linalg/symmetric_tridiagonal.rs +++ b/src/linalg/symmetric_tridiagonal.rs @@ -131,7 +131,7 @@ where } /// The diagonal components of this decomposition. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn diagonal(&self) -> OVector where DefaultAllocator: Allocator, @@ -140,7 +140,7 @@ where } /// The off-diagonal components of this decomposition. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn off_diagonal(&self) -> OVector> where DefaultAllocator: Allocator>, @@ -149,7 +149,7 @@ where } /// Computes the orthogonal matrix `Q` of this decomposition. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn q(&self) -> OMatrix { householder::assemble_q(&self.tri, self.off_diagonal.as_slice()) } diff --git a/src/linalg/udu.rs b/src/linalg/udu.rs index 786e14bc..7b4a9cc9 100644 --- a/src/linalg/udu.rs +++ b/src/linalg/udu.rs @@ -92,7 +92,7 @@ where } /// Returns the diagonal elements as a matrix - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn d_matrix(&self) -> OMatrix { OMatrix::from_diagonal(&self.d) } diff --git a/src/sparse/cs_matrix.rs b/src/sparse/cs_matrix.rs index f46dfdc2..74e13719 100644 --- a/src/sparse/cs_matrix.rs +++ b/src/sparse/cs_matrix.rs @@ -119,19 +119,19 @@ where DefaultAllocator: Allocator, { /// The value buffer of this storage. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn values(&self) -> &[T] { &self.vals } /// The column shifts buffer. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn p(&self) -> &[usize] { self.p.as_slice() } /// The row index buffers. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn i(&self) -> &[usize] { &self.i } @@ -359,32 +359,32 @@ impl> CsMatrix { } /// The size of the data buffer. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn len(&self) -> usize { self.data.len() } /// The number of rows of this matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn nrows(&self) -> usize { self.data.shape().0.value() } /// The number of rows of this matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn ncols(&self) -> usize { self.data.shape().1.value() } /// The shape of this matrix. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn shape(&self) -> (usize, usize) { let (nrows, ncols) = self.data.shape(); (nrows.value(), ncols.value()) } /// Whether this matrix is square or not. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn is_square(&self) -> bool { let (nrows, ncols) = self.data.shape(); nrows.value() == ncols.value() @@ -399,7 +399,7 @@ impl> CsMatrix { /// If at any time this `is_sorted` method returns `false`, then, something went wrong /// and an issue should be open on the nalgebra repository with details on how to reproduce /// this. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn is_sorted(&self) -> bool { for j in 0..self.ncols() { let mut curr = None; diff --git a/src/sparse/cs_matrix_cholesky.rs b/src/sparse/cs_matrix_cholesky.rs index 5891f0ad..6d52d0a6 100644 --- a/src/sparse/cs_matrix_cholesky.rs +++ b/src/sparse/cs_matrix_cholesky.rs @@ -67,7 +67,7 @@ where } /// The lower-triangular matrix of the cholesky decomposition. - #[must_use = "This function does not mutate self. You should use the return value."] + #[must_use] pub fn l(&self) -> Option<&CsMatrix> { if self.ok { Some(&self.l)