From 54e88de2a9bc85fcdebdf8110ee53f77ab45ddde Mon Sep 17 00:00:00 2001 From: EETagent Date: Mon, 14 Nov 2022 14:20:31 +0100 Subject: [PATCH] refactor: remove some unwraps from crypto --- core/src/crypto.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/crypto.rs b/core/src/crypto.rs index 8fe0582..9eaf538 100644 --- a/core/src/crypto.rs +++ b/core/src/crypto.rs @@ -126,7 +126,7 @@ pub async fn decrypt_password( password_cipher_text: String, key: String, ) -> Result { - let input = base64::decode(password_cipher_text).unwrap(); + let input = base64::decode(password_cipher_text)?; let plain = tokio::task::spawn_blocking(move || { let aes_key_nonce = convert_key_aes256(&key); @@ -139,7 +139,7 @@ pub async fn decrypt_password( }) .await??; - Ok(String::from_utf8(plain).unwrap()) + Ok(String::from_utf8(plain)?) } #[deprecated(note = "Too slow, use AES instead")]