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
pull/12938/head
Philippe Antoine 8 months ago committed by Victor Julien
parent 857efdde62
commit 0f3932afb7

@ -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);

Loading…
Cancel
Save