From: Jason Ish Date: Wed, 5 Oct 2022 14:58:03 +0000 (-0600) Subject: rust: fix clippy lints for clippy::manual_range_contains X-Git-Tag: suricata-7.0.0-beta1~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ec435a70397b6215e6e2af01b46c7be7bae6278;p=thirdparty%2Fsuricata.git rust: fix clippy lints for clippy::manual_range_contains --- diff --git a/rust/src/rdp/parser.rs b/rust/src/rdp/parser.rs index 8d69827bf9..f0b89da0c8 100644 --- a/rust/src/rdp/parser.rs +++ b/rust/src/rdp/parser.rs @@ -42,7 +42,7 @@ use nom7::{Err, IResult}; /// constrains dimension to a range, per spec /// rdp-spec, section 2.2.1.3.2 Client Core Data fn millimeters_to_opt(x: u32) -> Option { - if x >= 10 && x <= 10_000 { + if (10..=10_000).contains(&x) { Some(x) } else { None @@ -52,7 +52,7 @@ fn millimeters_to_opt(x: u32) -> Option { /// constrains desktop scale to a range, per spec /// rdp-spec, section 2.2.1.3.2 Client Core Data fn desktop_scale_to_opt(x: u32) -> Option { - if x >= 100 && x <= 500 { + if (100..=500).contains(&x) { Some(x) } else { None