autocommit 2022-01-08 23:04:44 CET
This commit is contained in:
parent
3336f1ab6a
commit
4efb187e24
3 changed files with 109 additions and 64 deletions
|
|
@ -7,18 +7,21 @@ pub trait MutPtrExt<T: ?Sized> {
|
|||
}
|
||||
|
||||
impl<T: ?Sized> PtrExt<T> for *const T {
|
||||
#[inline(always)]
|
||||
unsafe fn deref<'a>(self) -> &'a T {
|
||||
&*self
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: ?Sized> PtrExt<T> for *mut T {
|
||||
#[inline(always)]
|
||||
unsafe fn deref<'a>(self) -> &'a T {
|
||||
&*self
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: ?Sized> MutPtrExt<T> for *mut T {
|
||||
#[inline(always)]
|
||||
unsafe fn deref_mut<'a>(self) -> &'a mut T {
|
||||
&mut *self
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue