Skip to content

Commit

Permalink
Change range to 10
Browse files Browse the repository at this point in the history
Co-authored-by: Dustin J. Mitchell <[email protected]>
  • Loading branch information
randomPoison and djmitche authored Dec 17, 2024
1 parent a777704 commit 501fb48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/iterators/helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 501fb48

Please sign in to comment.