diff --git a/mbedtls/src/pk/mod.rs b/mbedtls/src/pk/mod.rs index cbbbd1537..2f4efd82f 100644 --- a/mbedtls/src/pk/mod.rs +++ b/mbedtls/src/pk/mod.rs @@ -870,7 +870,7 @@ impl Pk { pub fn write_private_der_vec(&mut self) -> Result> { crate::private::alloc_vec_repeat( - |buf, size| { let _ = &self; unsafe { pk_write_key_der(&mut self.inner, buf, size) } }, + |buf, size| { unsafe { pk_write_key_der(&mut self.inner, buf, size) } }, true, ) } @@ -886,7 +886,7 @@ impl Pk { } pub fn write_private_pem_string(&mut self) -> Result { - crate::private::alloc_string_repeat(|buf, size| { let _ = &self; unsafe { + crate::private::alloc_string_repeat(|buf, size| { unsafe { match pk_write_key_pem(&mut self.inner, buf as _, size) { 0 => crate::private::cstr_to_slice(buf as _).len() as _, r => r, @@ -906,7 +906,7 @@ impl Pk { pub fn write_public_der_vec(&mut self) -> Result> { crate::private::alloc_vec_repeat( - |buf, size| { let _ = &self; unsafe { pk_write_pubkey_der(&mut self.inner, buf, size) } }, + |buf, size| { unsafe { pk_write_pubkey_der(&mut self.inner, buf, size) } }, true, ) } @@ -922,7 +922,7 @@ impl Pk { } pub fn write_public_pem_string(&mut self) -> Result { - crate::private::alloc_string_repeat(|buf, size| { let _ = &self; unsafe { + crate::private::alloc_string_repeat(|buf, size| { unsafe { match pk_write_pubkey_pem(&mut self.inner, buf as _, size) { 0 => crate::private::cstr_to_slice(buf as _).len() as _, r => r,