From 3fe8e7e293001403fcc40bdea5b5cbdcf8b98d48 Mon Sep 17 00:00:00 2001
From: Federico Lolli <federico.lolli@skywarder.eu>
Date: Mon, 19 Feb 2024 00:25:01 +0100
Subject: [PATCH] increased maximum baudrate accepted

---
 src/lib.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib.rs b/src/lib.rs
index 5e17207..aec1000 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -108,9 +108,9 @@ fn open_serial(args: Args<'_>) -> SResult<()> {
         .map_mexerr(|e| Error::InvalidBaudrate(Box::new(e)))?;
     // Check for arg2 to resemble a baud rate (this type mismatch should be
     // fixed later on)
-    if arg2 != arg2.floor() || !(0.0..=921_600.0).contains(&arg2) {
+    if arg2 != arg2.floor() || !(0.0..=u32::MAX as f64).contains(&arg2) {
         return Err(Error::InvalidBaudrate(Box::new(Error::InvalidMatlabType(
-            "do not use decimal units, use a number between 0 and 115200".into(),
+            "do not use decimal units, use a number greater than zero".into(),
         ))));
     }
     let baudrate = arg2 as u32;
-- 
GitLab