1
0
Fork 0
forked from wry/wry

autocommit 2022-01-08 23:04:44 CET

This commit is contained in:
Julian Orth 2022-01-08 23:04:44 +01:00
parent 3336f1ab6a
commit 4efb187e24
3 changed files with 109 additions and 64 deletions

View file

@ -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
}