summaryrefslogtreecommitdiffstats
path: root/openpgp
diff options
context:
space:
mode:
authorNora Widdecke <nora@sequoia-pgp.org>2021-11-25 19:38:31 +0100
committerNora Widdecke <nora@sequoia-pgp.org>2021-11-29 11:53:56 +0100
commit286b6b54790e964800f91e2af3a8784aadc23b8b (patch)
treec12f5749c0d6fc332036c7d7ea920f726f949c6e /openpgp
parenta6e108eee52afade3a45aafb7bd3c7e3a150f367 (diff)
openpgp: Clearly return the Error.
- It's clearer to cast the error with .into() insead of ?. - Found by clippy::try_err.
Diffstat (limited to 'openpgp')
-rw-r--r--openpgp/src/crypto/backend/rust/asymmetric.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/openpgp/src/crypto/backend/rust/asymmetric.rs b/openpgp/src/crypto/backend/rust/asymmetric.rs
index 79f966cf..43a53dbc 100644
--- a/openpgp/src/crypto/backend/rust/asymmetric.rs
+++ b/openpgp/src/crypto/backend/rust/asymmetric.rs
@@ -166,10 +166,15 @@ impl Signer for KeyPair {
_ => Err(Error::UnsupportedEllipticCurve(curve.clone()).into()),
},
- (pk_algo, _, _) => Err(Error::InvalidOperation(format!(
- "unsupported combination of algorithm {:?}, key {:?}, \
- and secret key {:?}",
- pk_algo, self.public(), self.secret())))?,
+ (pk_algo, _, _) => {
+ Err(Error::InvalidOperation(format!(
+ "unsupported combination of algorithm {:?}, key {:?}, \
+ and secret key {:?}",
+ pk_algo,
+ self.public(),
+ self.secret()
+ )).into())
+ }
})
}
}