From 84c58f6020643364c54cdc91c0b9e426694df63d Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Tue, 7 May 2024 13:48:13 +0200 Subject: [PATCH] appease clippy --- crates/recursor/src/recursor.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/crates/recursor/src/recursor.rs b/crates/recursor/src/recursor.rs index f86f5143a..1c4777340 100644 --- a/crates/recursor/src/recursor.rs +++ b/crates/recursor/src/recursor.rs @@ -331,15 +331,12 @@ impl Recursor { // TODO: validation must be performed if the CD (Checking Disabled) is not set let mut answers = r.take_answers(); if !query_has_dnssec_ok { - answers = answers - .into_iter() - .filter(|rrset| { - // RFC 4035 section 3.2.1 if DO bit not set, strip DNSSEC records - // unless explicitly requested - let record_type = rrset.record_type(); - record_type == query.query_type() || !record_type.is_dnssec() - }) - .collect(); + answers.retain(|rrset| { + // RFC 4035 section 3.2.1 if DO bit not set, strip DNSSEC records + // unless explicitly requested + let record_type = rrset.record_type(); + record_type == query.query_type() || !record_type.is_dnssec() + }); } Ok(Lookup::new_with_max_ttl(query, Arc::from(answers)))