diff --git a/src/slicing.rs b/src/slicing.rs deleted file mode 100644 index d688297..0000000 --- a/src/slicing.rs +++ /dev/null @@ -1,32 +0,0 @@ -use super::*; - -/// A wrapper type for a boxed slice of an unknown size -#[derive(Debug)] -#[repr(transparent)] -pub struct OwnedUnboundedSlice -{ - first: T -} - -impl OwnedUnboundedSlice -{ - pub fn as_ptr(&self) -> *const T - { - &self.first as *const T - } - - pub fn as_mut_ptr(&mut self) -> *mut T - { - &mut self.first as *mut T - } - - pub unsafe fn as_slice(&self, size: usize) -> &[T] - { - std::slice::from_raw_parts(self.as_ptr(), size) - } - - pub unsafe fn as_mut_slice(&mut self, size: usize) -> &mut [T] - { - std::slice::from_raw_parts_mut(self.as_mut_ptr(), size) - } -}