From 0443248162186302ae8c50852e5498939b0abdc3 Mon Sep 17 00:00:00 2001 From: Avril Date: Mon, 17 Jan 2022 02:04:16 +0000 Subject: [PATCH] Removed unused dep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fortune for parapop's current commit: Small curse − 小凶 --- src/slicing.rs | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 src/slicing.rs 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) - } -}