From 9f85fe5d4d868c762c309c97b4d2a5beec1312f3 Mon Sep 17 00:00:00 2001 From: Hinton Date: Mon, 22 Apr 2024 18:39:00 +0200 Subject: [PATCH] Swap for generic --- crates/bitwarden-crypto/src/sensitive/sensitive.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/crates/bitwarden-crypto/src/sensitive/sensitive.rs b/crates/bitwarden-crypto/src/sensitive/sensitive.rs index 09df7b9d2..481058064 100644 --- a/crates/bitwarden-crypto/src/sensitive/sensitive.rs +++ b/crates/bitwarden-crypto/src/sensitive/sensitive.rs @@ -54,16 +54,9 @@ impl Sensitive { } } -/// Helper to convert a `Sensitive<[u8, 16]>` to a `SensitiveVec`. -impl From> for SensitiveVec { - fn from(sensitive: Sensitive<[u8; 16]>) -> Self { - SensitiveVec::new(Box::new(sensitive.value.to_vec())) - } -} - -/// Helper to convert a `Sensitive<[u8, 32]>` to a `SensitiveVec`. -impl From> for SensitiveVec { - fn from(sensitive: Sensitive<[u8; 32]>) -> Self { +/// Helper to convert a `Sensitive<[u8, N]>` to a `SensitiveVec`. +impl From> for SensitiveVec { + fn from(sensitive: Sensitive<[u8; N]>) -> Self { SensitiveVec::new(Box::new(sensitive.value.to_vec())) } }