1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-05 16:36:19 +02:00

Update while-let-expressions.md (#1018)

Update code snippet description to use `v.into_iter()`
instead of `v.iter()` since the former is what's actually
used in the code snippet.
This commit is contained in:
Shaurya Arora 2023-07-24 00:02:20 -04:00 committed by GitHub
parent c0e79596d4
commit f1058980e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,7 @@ fn main() {
}
```
Here the iterator returned by `v.iter()` will return a `Option<i32>` on every
Here the iterator returned by `v.into_iter()` will return a `Option<i32>` on every
call to `next()`. It returns `Some(x)` until it is done, after which it will
return `None`. The `while let` lets us keep iterating through all items.