Skip to content

Commit 5523b59

Browse files
committed
fix clippy error
1 parent 54e7f9a commit 5523b59

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/rng.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ macro_rules! rng_core {
130130
let mut i = 0_usize;
131131
while i < buffer.len() {
132132
let random_word = self.value()?;
133+
134+
// using to_ne_bytes does not work for u8 and would make the macro
135+
// implementation more complicated
136+
#[allow(clippy::transmute_num_to_bytes)]
133137
let bytes: [$type; BATCH_SIZE] = unsafe { mem::transmute(random_word) };
134138
let n = cmp::min(BATCH_SIZE, buffer.len() - i);
135139
buffer[i..i + n].copy_from_slice(&bytes[..n]);

0 commit comments

Comments
 (0)