From dbc1ecc376e0dee0a79595d39cf8085a72bc3e33 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Fri, 10 Oct 2025 11:07:19 -0400 Subject: [PATCH] Rust wrapper: remove a couple mut ptr casts --- wrapper/rust/wolfssl/src/wolfcrypt/ecc.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/wrapper/rust/wolfssl/src/wolfcrypt/ecc.rs b/wrapper/rust/wolfssl/src/wolfcrypt/ecc.rs index 49b29d26a..1b4034b94 100644 --- a/wrapper/rust/wolfssl/src/wolfcrypt/ecc.rs +++ b/wrapper/rust/wolfssl/src/wolfcrypt/ecc.rs @@ -1270,10 +1270,9 @@ impl ECC { /// let _x963_size = ecc.export_x963(&mut x963).expect("Error with export_x963()"); /// ``` pub fn export_x963(&mut self, dout: &mut [u8]) -> Result { - let dout_ptr = dout.as_ptr() as *mut u8; let mut out_len: u32 = dout.len() as u32; let rc = unsafe { - ws::wc_ecc_export_x963(&mut self.wc_ecc_key, dout_ptr, &mut out_len) + ws::wc_ecc_export_x963(&mut self.wc_ecc_key, dout.as_mut_ptr(), &mut out_len) }; if rc != 0 { return Err(rc); @@ -1303,10 +1302,9 @@ impl ECC { /// let _x963_size = ecc.export_x963_compressed(&mut x963).expect("Error with export_x963_compressed()"); /// ``` pub fn export_x963_compressed(&mut self, dout: &mut [u8]) -> Result { - let dout_ptr = dout.as_ptr() as *mut u8; let mut out_len: u32 = dout.len() as u32; let rc = unsafe { - ws::wc_ecc_export_x963_ex(&mut self.wc_ecc_key, dout_ptr, &mut out_len, 1) + ws::wc_ecc_export_x963_ex(&mut self.wc_ecc_key, dout.as_mut_ptr(), &mut out_len, 1) }; if rc != 0 { return Err(rc);