From 70a28d3767f3026555fe6f6d64aeffa398de2e0f Mon Sep 17 00:00:00 2001 From: aniampio Date: Wed, 3 Nov 2021 15:38:32 +0000 Subject: [PATCH] Change expect to unwrap --- common/nymcoconut/src/elgamal.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common/nymcoconut/src/elgamal.rs b/common/nymcoconut/src/elgamal.rs index bec5e68337..87b77bfa2e 100644 --- a/common/nymcoconut/src/elgamal.rs +++ b/common/nymcoconut/src/elgamal.rs @@ -44,8 +44,8 @@ impl TryFrom<&[u8]> for Ciphertext { ))); } - let c1_bytes: &[u8; 48] = &bytes[..48].try_into().expect("Slice size != 48"); - let c2_bytes: &[u8; 48] = &bytes[48..].try_into().expect("Slice size != 48"); + let c1_bytes: &[u8; 48] = &bytes[..48].try_into().unwrap(); + let c2_bytes: &[u8; 48] = &bytes[48..].try_into().unwrap(); let c1 = try_deserialize_g1_projective( c1_bytes, @@ -112,7 +112,7 @@ impl PrivateKey { .to_string(), ), ) - .map(PrivateKey) + .map(PrivateKey) } } @@ -183,7 +183,7 @@ impl TryFrom<&[u8]> for PublicKey { "Failed to deserialize compressed ElGamal public key".to_string(), ), ) - .map(PublicKey) + .map(PublicKey) } } @@ -326,7 +326,7 @@ mod tests { ciphertext.0.to_affine().to_compressed(), ciphertext.1.to_affine().to_compressed(), ] - .concat(); + .concat(); assert_eq!(expected_bytes, bytes); assert_eq!(ciphertext, Ciphertext::try_from(&bytes[..]).unwrap()) }