Recommend NonZero*::new.unwrap()
over NonZero*::new_unchecked
in const
s
#13991
Labels
A-lint
Area: New lints
What it does
Just found out that
Option::unwrap
is now aconst fn
; had I not ran into that, I wouldn't have changed my use ofNonZero*::new_unchecked
forconst
variables.Advantage
unsafe
code is needed.Drawbacks
unwrap_used
.Example
Could be written as:
The text was updated successfully, but these errors were encountered: