autocommit 2022-01-06 19:08:32 CET
This commit is contained in:
parent
cbbc41a463
commit
4a939477a2
51 changed files with 3438 additions and 207 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue