Remove unused PointerExt trait

This commit is contained in:
Simon Ask Ulsnes 2024-02-02 11:15:45 +01:00
parent 01246c21c8
commit 176c0edfdb

View file

@ -36,24 +36,6 @@
extern crate alloc;
use core::mem::size_of;
trait PointerExt: Sized {
fn c_offset_from(self, origin: Self) -> isize;
}
impl<T> PointerExt for *const T {
fn c_offset_from(self, origin: *const T) -> isize {
(self as isize - origin as isize) / size_of::<T>() as isize
}
}
impl<T> PointerExt for *mut T {
fn c_offset_from(self, origin: *mut T) -> isize {
(self as isize - origin as isize) / size_of::<T>() as isize
}
}
#[macro_use]
mod macros;