From 3ec435a70397b6215e6e2af01b46c7be7bae6278 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Wed, 5 Oct 2022 08:58:03 -0600 Subject: [PATCH] rust: fix clippy lints for clippy::manual_range_contains --- rust/src/rdp/parser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.47.2