diff --git a/crates/bitwarden-crypto/src/service/context.rs b/crates/bitwarden-crypto/src/service/context.rs index f8e086ab1..61b3b9fab 100644 --- a/crates/bitwarden-crypto/src/service/context.rs +++ b/crates/bitwarden-crypto/src/service/context.rs @@ -21,6 +21,7 @@ pub(crate) struct RustCryptoServiceContext< pub(crate) local_asymmetric_keys: Box>, } +#[allow(unused)] impl<'a, SymmKeyRef: SymmetricKeyRef, AsymmKeyRef: AsymmetricKeyRef> RustCryptoServiceContext<'a, SymmKeyRef, AsymmKeyRef> { diff --git a/crates/bitwarden-crypto/src/service/key_store/rust_impl.rs b/crates/bitwarden-crypto/src/service/key_store/rust_impl.rs index ac5d51ab9..ee79edd10 100644 --- a/crates/bitwarden-crypto/src/service/key_store/rust_impl.rs +++ b/crates/bitwarden-crypto/src/service/key_store/rust_impl.rs @@ -1,5 +1,3 @@ -use std::mem::MaybeUninit; - use super::{ util::{KeyData, SliceKeyStore}, KeyRef, @@ -17,8 +15,10 @@ pub(crate) struct RustImplKeyData { impl Drop for RustImplKeyData { fn drop(&mut self) { - #[cfg(any(not(target_arch = "wasm32"), not(feature = "no-memory-hardening")))] + #[cfg(all(not(target_arch = "wasm32"), not(feature = "no-memory-hardening")))] { + use std::mem::MaybeUninit; + let entry_size = std::mem::size_of::>(); unsafe { memsec::munlock( @@ -47,9 +47,10 @@ impl KeyData for RustImplKeyData { } fn with_capacity(capacity: usize) -> Self { + #[allow(unused_mut)] let mut data: Box<_> = std::iter::repeat_with(|| None).take(capacity).collect(); - #[cfg(any(not(target_arch = "wasm32"), not(feature = "no-memory-hardening")))] + #[cfg(all(not(target_arch = "wasm32"), not(feature = "no-memory-hardening")))] { let entry_size = std::mem::size_of::>(); unsafe {