Skip to content

Commit

Permalink
Use .to_le_bytes() instead of .to_le().to_ne_bytes()
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnatsel committed Apr 5, 2020
1 parent 93ee2fd commit 5489851
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rand_core/src/lib.rs
Expand Up @@ -41,7 +41,6 @@

use core::convert::AsMut;
use core::default::Default;
use core::ptr::copy_nonoverlapping;

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

Self::from_seed(seed)
Expand Down

0 comments on commit 5489851

Please sign in to comment.