Add `get_mut` annotations (second try)

This commit is contained in:
Malte Tammena 2021-06-07 17:24:43 +02:00
parent 38e9a5da33
commit 9eb9ad603f
1 changed files with 2 additions and 0 deletions

View File

@ -156,6 +156,7 @@ impl<T> CsMatrix<T> {
} }
#[inline] #[inline]
#[must_use]
pub fn get_lane_mut(&mut self, index: usize) -> Option<CsLaneMut<T>> { pub fn get_lane_mut(&mut self, index: usize) -> Option<CsLaneMut<T>> {
let range = self.get_index_range(index)?; let range = self.get_index_range(index)?;
let minor_dim = self.pattern().minor_dim(); let minor_dim = self.pattern().minor_dim();
@ -429,6 +430,7 @@ impl<'a, T> CsLaneMut<'a, T> {
(self.minor_indices, self.values) (self.minor_indices, self.values)
} }
#[must_use]
pub fn get_entry_mut(&mut self, global_minor_index: usize) -> Option<SparseEntryMut<T>> { pub fn get_entry_mut(&mut self, global_minor_index: usize) -> Option<SparseEntryMut<T>> {
get_mut_entry_from_slices( get_mut_entry_from_slices(
self.minor_dim, self.minor_dim,