From 501fb4814f8796d159572435b439b7250785535d Mon Sep 17 00:00:00 2001 From: Nicole L Date: Tue, 17 Dec 2024 14:19:41 -0800 Subject: [PATCH] Change range to 10 Co-authored-by: Dustin J. Mitchell --- src/iterators/helpers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iterators/helpers.md b/src/iterators/helpers.md index f384fe85152..2cc0ec51670 100644 --- a/src/iterators/helpers.md +++ b/src/iterators/helpers.md @@ -9,7 +9,7 @@ In addition to the `next` method that defines how an iterator behaves, the customized iterators. ```rust,editable -let result: i32 = (1..10) // Create a range from 1 to 9 +let result: i32 = (1..=10) // Create a range from 1 to 10 .filter(|&x| x % 2 == 0) // Keep only even numbers .map(|x| x * x) // Square each number .sum(); // Sum up all the squared numbers