mirror of
https://github.com/rust-lang/book.git
synced 2026-09-15 10:10:42 -04:00
Merge pull request #553 from shepmaster/no-inclusive-range
Inclusive ranges are not stable, don't tell people to use them
This commit is contained in:
@@ -14,10 +14,9 @@ Now that you know more Rust, we can talk in detail about how this works.
|
||||
Ranges (the `0..10`) are 'iterators'. An iterator is something that we can
|
||||
call the `.next()` method on repeatedly, and it gives us a sequence of things.
|
||||
|
||||
(By the way, a range with two dots like `0..10` is inclusive on the left (so it
|
||||
A range with two dots like `0..10` is inclusive on the left (so it
|
||||
starts at 0) and exclusive on the right (so it ends at 9). A mathematician
|
||||
would write "[0, 10)". To get a range that goes all the way up to 10 you can
|
||||
write `0...10`.)
|
||||
would write "[0, 10)".
|
||||
|
||||
Like this:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user