]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: fix clippy lints for clippy::manual_range_contains
authorJason Ish <jason.ish@oisf.net>
Wed, 5 Oct 2022 14:58:03 +0000 (08:58 -0600)
committerVictor Julien <vjulien@oisf.net>
Mon, 24 Oct 2022 09:20:08 +0000 (11:20 +0200)
rust/src/rdp/parser.rs

index 8d69827bf9814fe2891e567e3d5d386fe7e4348f..f0b89da0c84a1f3e02652f0e5a005866f8b9fe2e 100644 (file)
@@ -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<u32> {
-    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<u32> {
 /// 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<u32> {
-    if x >= 100 && x <= 500 {
+    if (100..=500).contains(&x) {
         Some(x)
     } else {
         None