From 858739519d8eab629dad83d61c83e58f4bfcca97 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Thu, 3 Apr 2025 13:43:29 +0200 Subject: [PATCH] rust: fix clippy warning manual_contains warning: using `contains()` instead of `iter().any()` is more efficient --> src/http2/http2.rs:267:20 | 267 | if block.value.iter().any(|&x| x == b'@') { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `block.value.contains(&b'@')` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains = note: `#[warn(clippy::manual_contains)]` on by default (cherry picked from commit 0f3932afb78680c8af167f2089f52e0342431b1f) --- rust/src/http2/http2.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/src/http2/http2.rs b/rust/src/http2/http2.rs index eace93ccc3..20b7cd9474 100644 --- a/rust/src/http2/http2.rs +++ b/rust/src/http2/http2.rs @@ -212,7 +212,7 @@ impl HTTP2Transaction { self.decoder.http2_encoding_fromvec(&block.value, dir); } else if block.name.eq_ignore_ascii_case(b":authority") { authority = Some(&block.value); - if block.value.iter().any(|&x| x == b'@') { + if block.value.contains(&b'@') { // it is forbidden by RFC 9113 to have userinfo in this field // when in HTTP1 we can have user:password@domain.com self.set_event(HTTP2Event::UserinfoInUri); -- 2.47.2