1
0
Fork 0
forked from wry/wry

autocommit 2022-01-06 19:08:32 CET

This commit is contained in:
Julian Orth 2022-01-06 19:08:32 +01:00
parent cbbc41a463
commit 4a939477a2
51 changed files with 3438 additions and 207 deletions

View file

@ -1,24 +1,24 @@
pub trait PtrExt<T> {
pub trait PtrExt<T: ?Sized> {
unsafe fn deref<'a>(self) -> &'a T;
}
pub trait MutPtrExt<T> {
pub trait MutPtrExt<T: ?Sized> {
unsafe fn deref_mut<'a>(self) -> &'a mut T;
}
impl<T> PtrExt<T> for *const T {
impl<T: ?Sized> PtrExt<T> for *const T {
unsafe fn deref<'a>(self) -> &'a T {
&*self
}
}
impl<T> PtrExt<T> for *mut T {
impl<T: ?Sized> PtrExt<T> for *mut T {
unsafe fn deref<'a>(self) -> &'a T {
&*self
}
}
impl<T> MutPtrExt<T> for *mut T {
impl<T: ?Sized> MutPtrExt<T> for *mut T {
unsafe fn deref_mut<'a>(self) -> &'a mut T {
&mut *self
}