Skip to content

Commit 4c62755

Browse files
committed
It's just a thin veil
1 parent 31f7100 commit 4c62755

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rng.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ impl crate::hal::blocking::rng::Read for Rng {
115115
let mut i = 0usize;
116116
while i < buffer.len() {
117117
let random_word: u32 = self.get_random_data();
118-
let bytes = unsafe { transmute::<u32, [u8; 4]>(random_word) };
118+
let bytes: [u8; 4] = random_word.to_ne_bytes();
119119
let n = cmp::min(4, buffer.len() - i);
120120
buffer[i..i + n].copy_from_slice(&bytes[..n]);
121121
i += n;

0 commit comments

Comments
 (0)