You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that we're using NonNull instead of *mut, we're sometimes using Option<NonNull<T>> where we would otherwise use a *mut T that could be null. Where we previously would have dereferenced if we already knew that the pointer was non-null, we now have to do ptr.unwrap(), which incurs runtime overhead.
Now that we're using
NonNull
instead of*mut
, we're sometimes usingOption<NonNull<T>>
where we would otherwise use a*mut T
that could be null. Where we previously would have dereferenced if we already knew that the pointer was non-null, we now have to doptr.unwrap()
, which incurs runtime overhead.Instead, we should use unsafe_unwrap or a stdlib equivalent if one is ever added (see rust-lang/rust#48278).
The text was updated successfully, but these errors were encountered: