Skip to content

Commit

Permalink
Fix use of transmute_copy in GenRandom
Browse files Browse the repository at this point in the history
Signed-off-by: Jiahao XU <[email protected]>
  • Loading branch information
NobodyXu authored Jan 27, 2025
1 parent cf9a496 commit c839157
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,6 @@ impl GenRandom for u128 {

getrandom::fill_uninit(&mut uninit_bytes)?;

Ok(u128::from_ne_bytes(transmute_copy(uninit_bytes)))
Ok(u128::from_ne_bytes(unsafe { transmute_copy(&uninit_bytes) }))
}
}

0 comments on commit c839157

Please sign in to comment.