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
One obvious optimization that is possible with NonZeroXxx aside from simply elision of extra storage for Option<NonZeroXxx> is that it enables safe unchecked code that skips divide by zero checking.
It would be nice if, e.g., Rem<NonZeroUsize> were implemented for usize such that this would be a valid operation:
One obvious optimization that is possible with
NonZeroXxx
aside from simply elision of extra storage forOption<NonZeroXxx>
is that it enables safe unchecked code that skips divide by zero checking.It would be nice if, e.g.,
Rem<NonZeroUsize>
were implemented forusize
such that this would be a valid operation:This would be guaranteed panic free and there would be no need to generate the code that handles the case where
divisor
is zero.The text was updated successfully, but these errors were encountered: