Open
Description
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:
- where can raw pointers be replaced with
ptr::Unique<T>
s?- We already use
Unique
in some cases - I think there might be more uses of raw pointers that can be replaced with
Unique
.
- We already use
- where can pointer math be replaced with
pointer.offset()
?- this is considered more idiomatic
- has less ugly casts/can be less wordy
- where can coercing raw pointers to references be replaced with
pointer.as_ref()
orpointer.as_mut()
?- these functions can still return references to uninitialised memory, but they're more null-safe (allow us to handle null pointers
Option
ally) - fewer ugly casts/transmutes
- these functions can still return references to uninitialised memory, but they're more null-safe (allow us to handle null pointers
- where can
mem::transmute
-ting a reference into a raw pointer be replaced with&*
?- this is more idiomatic
Activity