From 0f3932afb78680c8af167f2089f52e0342431b1f 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 --- 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 eac3c88482..ddc93940dc 100644 --- a/rust/src/http2/http2.rs +++ b/rust/src/http2/http2.rs @@ -264,7 +264,7 @@ impl HTTP2Transaction { path = Some(&block.value); } 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