diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-09-21 16:10:15 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@sequoia-pgp.org> | 2021-09-30 08:31:03 +0300 |
commit | 795b89ae024d3d49a6f08283184b22770e160317 (patch) | |
tree | ff3b8268f6383e415f19058b308202229956d615 /sq/src/sq.rs | |
parent | 42fe483fa2138629572e13539d6274e59c28d6d1 (diff) |
When returning an error, use "return" instead of "?"
Instead of
Err(...)?;
which is correct but not idiomatic, write this:
return Err(...);
This was found by clippy lintt try_err:
https://rust-lang.github.io/rust-clippy/master/index.html#try_err
Sponsored-by: author
Diffstat (limited to 'sq/src/sq.rs')
-rw-r--r-- | sq/src/sq.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sq/src/sq.rs b/sq/src/sq.rs index fb6567f5..1c692ec0 100644 --- a/sq/src/sq.rs +++ b/sq/src/sq.rs @@ -137,8 +137,8 @@ fn load_keys<'a, I>(files: I) -> openpgp::Result<Vec<Cert>> let cert = Cert::from_file(f) .context(format!("Failed to load key from file {:?}", f))?; if ! cert.is_tsk() { - Err(anyhow::anyhow!( - "Cert in file {:?} does not contain secret keys", f))?; + return Err(anyhow::anyhow!( + "Cert in file {:?} does not contain secret keys", f)); } certs.push(cert); } |