We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91e8044 commit 7df3bf1Copy full SHA for 7df3bf1
src/doc/book/loops.md
@@ -125,7 +125,8 @@ Don't forget to add the parentheses around the range.
125
#### On iterators:
126
127
```rust
128
-# let lines = "hello\nworld".lines();
+let lines = "hello\nworld".lines();
129
+
130
for (linenumber, line) in lines.enumerate() {
131
println!("{}: {}", linenumber, line);
132
}
@@ -134,10 +135,8 @@ for (linenumber, line) in lines.enumerate() {
134
135
Outputs:
136
137
```text
-0: Content of line one
138
-1: Content of line two
139
-2: Content of line three
140
-3: Content of line four
+0: hello
+1: world
141
```
142
143
## Ending iteration early
0 commit comments