From 4aed46f42a3d9d243577ebc7f6efe62571d40b56 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Mon, 20 May 2024 19:15:36 -0700 Subject: [PATCH] Use `ptr.cast()` instead of `mem::transmute(ptr)`. --- src/netbsd.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/netbsd.rs b/src/netbsd.rs index 34c77837..4733beb5 100644 --- a/src/netbsd.rs +++ b/src/netbsd.rs @@ -31,7 +31,7 @@ pub fn getrandom_inner(dest: &mut [MaybeUninit]) -> Result<(), Error> { // getrandom(2) was introduced in NetBSD 10.0 static GETRANDOM: Weak = unsafe { Weak::new("getrandom\0") }; if let Some(fptr) = GETRANDOM.ptr() { - let func: GetRandomFn = unsafe { core::mem::transmute(fptr) }; + let func = fptr.cast::(); return sys_fill_exact(dest, |buf| unsafe { func(buf.as_mut_ptr().cast::(), buf.len(), 0) });