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