diff --git a/extendr-api/src/wrapper/matrix.rs b/extendr-api/src/wrapper/matrix.rs index 53b7386bb5..c9b5bec14f 100644 --- a/extendr-api/src/wrapper/matrix.rs +++ b/extendr-api/src/wrapper/matrix.rs @@ -31,6 +31,7 @@ pub struct RArray { /// Dimensions of the array. dim: D, + _data: std::marker::PhantomData, } @@ -146,16 +147,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