mirror of
https://github.com/simonask/libyaml-safer
synced 2024-11-26 21:30:24 +00:00
Remove unused PointerExt trait
This commit is contained in:
parent
01246c21c8
commit
176c0edfdb
1 changed files with 0 additions and 18 deletions
18
src/lib.rs
18
src/lib.rs
|
@ -36,24 +36,6 @@
|
||||||
|
|
||||||
extern crate alloc;
|
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]
|
#[macro_use]
|
||||||
mod macros;
|
mod macros;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue