summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-09-29 08:57:51 +0300
committerLars Wirzenius <liw@sequoia-pgp.org>2021-09-30 08:31:16 +0300
commit618aa1d65d9748a0f66fbb1be0a7509544d53c2f (patch)
tree9c12c3bcb6434e47d6c39ac200a441d316f721e7
parent3e1cb18dae463a5b72f3a4c9ebcfe9a05c19fee3 (diff)
Allow if conditions that use complex code
An if condition is an expression and can be as complex as the programmer wants. However, the more complex a condition is, the harder it tends to be to understand. I marked functions with such if conditions so that clippy won't complain about the code. I probably should have simplified the code, perhaps by extracting the condition to its own function, but it would have been much harder to do, so I didn't. Found by clippy lint blocks_in_if_conditions: https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_if_conditions
-rw-r--r--net/src/lib.rs1
-rw-r--r--openpgp/src/cert/bundle.rs1
-rw-r--r--openpgp/src/parse.rs1
-rw-r--r--openpgp/src/parse/stream.rs1
4 files changed, 4 insertions, 0 deletions
diff --git a/net/src/lib.rs b/net/src/lib.rs
index 74f0ecfb..cf94557a 100644
--- a/net/src/lib.rs
+++ b/net/src/lib.rs
@@ -289,6 +289,7 @@ impl KeyServer {
///
/// Returned certificates must be mistrusted, and be carefully
/// interpreted under a policy and trust model.
+ #[allow(clippy::blocks_in_if_conditions)]
pub async fn search<U: Into<UserID>>(&mut self, userid: U)
-> Result<Vec<Cert>>
{
diff --git a/openpgp/src/cert/bundle.rs b/openpgp/src/cert/bundle.rs
index ab634aa3..6eea1248 100644
--- a/openpgp/src/cert/bundle.rs
+++ b/openpgp/src/cert/bundle.rs
@@ -587,6 +587,7 @@ impl<C> ComponentBundle<C> {
/// even if there is a newer self-signature).
///
/// selfsig must be the newest live self signature at time `t`.
+ #[allow(clippy::blocks_in_if_conditions)]
pub(crate) fn _revocation_status<'a, T>(&'a self, policy: &dyn Policy, t: T,
hard_revocations_are_final: bool,
selfsig: Option<&Signature>)
diff --git a/openpgp/src/parse.rs b/openpgp/src/parse.rs
index 11f2f3e3..55489be7 100644
--- a/openpgp/src/parse.rs
+++ b/openpgp/src/parse.rs
@@ -1874,6 +1874,7 @@ impl OnePassSig {
impl_parse_generic_packet!(OnePassSig);
impl OnePassSig3 {
+ #[allow(clippy::blocks_in_if_conditions)]
fn parse<'a, T: 'a + BufferedReader<Cookie>>(mut php: PacketHeaderParser<T>)
-> Result<PacketParser<'a>>
{
diff --git a/openpgp/src/parse/stream.rs b/openpgp/src/parse/stream.rs
index 8d92dab5..141b8f5c 100644
--- a/openpgp/src/parse/stream.rs
+++ b/openpgp/src/parse/stream.rs
@@ -2609,6 +2609,7 @@ impl<'a, H: VerificationHelper + DecryptionHelper> Decryptor<'a, H> {
}
/// Verifies the signatures.
+ #[allow(clippy::blocks_in_if_conditions)]
fn verify_signatures(&mut self) -> Result<()> {
tracer!(TRACE, "Decryptor::verify_signatures", 0);
t!("called");