Skip to content

Commit

Permalink
Swap for generic
Browse files Browse the repository at this point in the history
  • Loading branch information
Hinton committed Apr 22, 2024
1 parent 1b6873e commit 9f85fe5
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions crates/bitwarden-crypto/src/sensitive/sensitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,9 @@ impl<V: Zeroize> Sensitive<V> {
}
}

/// Helper to convert a `Sensitive<[u8, 16]>` to a `SensitiveVec`.
impl From<Sensitive<[u8; 16]>> 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<Sensitive<[u8; 32]>> for SensitiveVec {
fn from(sensitive: Sensitive<[u8; 32]>) -> Self {
/// Helper to convert a `Sensitive<[u8, N]>` to a `SensitiveVec`.
impl<const N: usize> From<Sensitive<[u8; N]>> for SensitiveVec {
fn from(sensitive: Sensitive<[u8; N]>) -> Self {
SensitiveVec::new(Box::new(sensitive.value.to_vec()))
}
}
Expand Down

0 comments on commit 9f85fe5

Please sign in to comment.