mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-02-03 07:48:41 +08:00
Merge pull request #362 from dawirstejeck/off_by_one
Fix off-by-one mistake in while loop explanation
This commit is contained in:
commit
7d2a7b45a9
@ -383,7 +383,7 @@ the value is: 50
|
||||
```
|
||||
|
||||
All five array values appear in the terminal, as expected. Even though `index`
|
||||
will reach a value of `6` at some point, the loop stops executing before trying
|
||||
will reach a value of `5` at some point, the loop stops executing before trying
|
||||
to fetch a sixth value from the array.
|
||||
|
||||
But this approach is error prone; we could cause the program to panic if the
|
||||
|
Loading…
Reference in New Issue
Block a user