Skip to content

Commit 5489851

Browse files
committed
Use .to_le_bytes() instead of .to_le().to_ne_bytes()
1 parent 93ee2fd commit 5489851

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

rand_core/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141

4242
use core::convert::AsMut;
4343
use core::default::Default;
44-
use core::ptr::copy_nonoverlapping;
4544

4645
#[cfg(all(feature = "alloc", not(feature = "std")))] extern crate alloc;
4746
#[cfg(all(feature = "alloc", not(feature = "std")))] use alloc::boxed::Box;
@@ -313,8 +312,8 @@ pub trait SeedableRng: Sized {
313312
// Use PCG output function with to_le to generate x:
314313
let xorshifted = (((state >> 18) ^ state) >> 27) as u32;
315314
let rot = (state >> 59) as u32;
316-
let x = xorshifted.rotate_right(rot).to_le();
317-
chunk.copy_from_slice(&x.to_ne_bytes());
315+
let x = xorshifted.rotate_right(rot);
316+
chunk.copy_from_slice(&x.to_le_bytes());
318317
}
319318

320319
Self::from_seed(seed)

0 commit comments

Comments
 (0)