From 7c6a4e5ecea551d21eb1518245878729c6ea283d Mon Sep 17 00:00:00 2001 From: Jeff Date: Thu, 24 Aug 2023 05:32:47 -0400 Subject: [PATCH] Fix bug --- src/tools/random.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/random.rs b/src/tools/random.rs index a9e93da..67176c4 100644 --- a/src/tools/random.rs +++ b/src/tools/random.rs @@ -56,8 +56,8 @@ impl Tool for RandomInteger { Error::expect_function_argument_amount(self.info().identifier, min_max.len(), 2)?; let min = min_max[0].as_int()?; - let max = min_max[1].as_int()?; - let integer = rand::thread_rng().gen_range(min..=max); + let max = min_max[1].as_int()? + 1; + let integer = rand::thread_rng().gen_range(min..max); Ok(Value::Integer(integer)) }