Skip to content

Commit c839157

Browse files
authored
Fix use of transmute_copy in GenRandom
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
1 parent cf9a496 commit c839157

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,6 @@ impl GenRandom for u128 {
815815

816816
getrandom::fill_uninit(&mut uninit_bytes)?;
817817

818-
Ok(u128::from_ne_bytes(transmute_copy(uninit_bytes)))
818+
Ok(u128::from_ne_bytes(unsafe { transmute_copy(&uninit_bytes) }))
819819
}
820820
}

0 commit comments

Comments
 (0)