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
Not sure when this code was written, but by replacing rng.next_u64().to_le() with rng.next_u64().to_le_bytes() we can cut down on some transmutes.
Now, yes, of course to_le_bytes does the transmute internally, but we should avoid unsafe and let the standard library do it as often as possible simply on principle.
That method was stable in 1.32, and the README badge indicates that that's the minimum rust version of rand these days, so it should be an easy change.
Not sure when this code was written, but by replacing
rng.next_u64().to_le()
withrng.next_u64().to_le_bytes()
we can cut down on some transmutes.Now, yes, of course
to_le_bytes
does thetransmute
internally, but we should avoid unsafe and let the standard library do it as often as possible simply on principle.That method was stable in 1.32, and the README badge indicates that that's the minimum rust version of
rand
these days, so it should be an easy change.Has an old TODO for when the compiler gets to 1.25, which we're at.
The text was updated successfully, but these errors were encountered: