Suggest ptr::null_mut::<T>()
instead of ptr::null::<T>() as *mut T
#13361
Labels
A-lint
Area: New lints
ptr::null_mut::<T>()
instead of ptr::null::<T>() as *mut T
#13361
What it does
Use the
null_mut()
directly instead of first creating a read-onlynull()
and casting itAdvantage
Drawbacks
none
Example
Could be written as:
The text was updated successfully, but these errors were encountered: