We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af3decc commit 084066aCopy full SHA for 084066a
psa-crypto/src/operations/cipher.rs
@@ -32,7 +32,8 @@ fn crypt(
32
33
let mut output_length = 0;
34
let mut output_length_finish = 0;
35
- match (|| {
+
36
+ let status = {
37
Status::from(unsafe {
38
psa_crypto_sys::psa_cipher_set_iv(&mut operation, iv.as_ptr(), iv.len())
39
})
@@ -61,16 +62,16 @@ fn crypt(
61
62
.to_result()?;
63
64
Ok(())
- })() {
65
- Ok(()) => (),
+ };
66
67
+ match status {
68
+ Ok(()) => Ok(output_length + output_length_finish),
69
Err(x) => {
70
Status::from(unsafe { psa_crypto_sys::psa_cipher_abort(&mut operation) })
71
- return Err(x);
72
+ Err(x)
73
}
74
-
- Ok(output_length + output_length_finish)
75
76
77
/// Encrypt a short message with a key
0 commit comments