Skip to content

Commit

Permalink
fix: removed extra data_mut function
Browse files Browse the repository at this point in the history
  • Loading branch information
CGMossa committed Jan 28, 2024
1 parent d847ab4 commit a5d07d9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions extendr-api/src/wrapper/matrix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub struct RArray<T, D> {

/// Dimensions of the array.
dim: D,

_data: std::marker::PhantomData<T>,
}

Expand Down Expand Up @@ -102,16 +103,11 @@ where
self.as_typed_slice().unwrap()
}

/// Returns a flat mutable representation of the array in col-major.
/// Returns a flat, mutable representation of the array in col-major.
pub fn data_mut(&mut self) -> &'a mut [T] {
self.as_typed_slice_mut().unwrap()
}

/// Get mutable access to the underlying data
pub fn data_mut(&mut self) -> &mut [T] {
unsafe { std::slice::from_raw_parts_mut(self.data, self.robj.len()) }
}

/// Get the dimensions for this array.
pub fn dim(&self) -> &D {
&self.dim
Expand Down

0 comments on commit a5d07d9

Please sign in to comment.