]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
tor-c-equix: Fix clippy warning
authorMicah Elizabeth Scott <beth@torproject.org>
Mon, 14 Aug 2023 20:12:06 +0000 (13:12 -0700)
committerMicah Elizabeth Scott <beth@torproject.org>
Tue, 15 Aug 2023 16:52:30 +0000 (09:52 -0700)
Clippy found a transmute that could have been a reborrow.

src/ext/equix/src/lib.rs

index 8eb163075a5bd2271704449d076fba5c3cd894ba..716160b4d51345d03c2f3950e8316690745356f8 100644 (file)
@@ -114,7 +114,7 @@ impl HashX {
             },
         }
         unsafe extern "C" fn wrapper(buffer: *mut u64, callback: *mut c_void) {
-            let callback: &mut RngCallback = unsafe { mem::transmute(callback) };
+            let callback = &mut *(callback as *mut RngCallback);
             buffer.write(callback(buffer.read()));
         }
         result