From 08e9ef16affa53e6420f7bcd0a4f1b8edf8351b6 Mon Sep 17 00:00:00 2001 From: codeandplay Date: Fri, 1 Jan 2021 16:00:41 +0000 Subject: [PATCH] Update rand-range.md fix incorrect usage of rng.gen_range --- src/algorithms/randomness/rand-range.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/randomness/rand-range.md b/src/algorithms/randomness/rand-range.md index 6c4701e..9dc6065 100644 --- a/src/algorithms/randomness/rand-range.md +++ b/src/algorithms/randomness/rand-range.md @@ -9,8 +9,8 @@ use rand::Rng; fn main() { let mut rng = rand::thread_rng(); - println!("Integer: {}", rng.gen_range(0, 10)); - println!("Float: {}", rng.gen_range(0.0, 10.0)); + println!("Integer: {}", rng.gen_range(0..10)); + println!("Float: {}", rng.gen_range(0.0..10.0)); } ```