diff --git a/src/lib.rs b/src/lib.rs index fae8dc16a..ddfb8fb7d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -77,7 +77,6 @@ pub mod parser; pub mod parser_keywords; pub mod path; -pub mod pointer; pub mod print_help; pub mod proc; pub mod re; diff --git a/src/pointer.rs b/src/pointer.rs deleted file mode 100644 index 8d0783235..000000000 --- a/src/pointer.rs +++ /dev/null @@ -1,35 +0,0 @@ -use std::ops::Deref; - -/// Raw pointer that implements Default. -/// Additionally it implements Deref so it's more ergonomic than Option. -#[derive(Debug)] -pub struct ConstPointer(pub *const T); - -impl From<&T> for ConstPointer { - fn from(value: &T) -> Self { - Self(value) - } -} - -impl Default for ConstPointer { - fn default() -> Self { - Self(std::ptr::null()) - } -} - -impl Clone for ConstPointer { - fn clone(&self) -> Self { - *self - } -} - -impl Copy for ConstPointer {} - -impl Deref for ConstPointer { - type Target = T; - - fn deref(&self) -> &Self::Target { - assert!(!self.0.is_null()); - unsafe { &*self.0 } - } -}