Open hawkw opened 7 years ago
Another way we could potentially improve safety is by 'downgrading' some *mut
pointers to *const
pointers. Potentially, there might also be some *const
pointers that could be downgraded to &'static
references...
I think there are at least a few cases where we can work on refactoring code that uses raw pointers to be somewhat more idiomatic:
ptr::Unique<T>
s?Unique
in some casesUnique
.pointer.offset()
?pointer.as_ref()
orpointer.as_mut()
?Option
ally)mem::transmute
-ting a reference into a raw pointer be replaced with&*
?