Skip to content

Commit e3a5b75

Browse files
committed
Rollup merge of rust-lang#31344 - steveklabnik:gh31334, r=alexcrichton
Fixes rust-lang#31334 This is just a quicker fix for this issue; since I'm working on the next draft of the book, I don't want to put a huuuge amount of work into improving it here.
2 parents a0f8788 + 7df3bf1 commit e3a5b75

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/doc/book/loops.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ Don't forget to add the parentheses around the range.
125125
#### On iterators:
126126

127127
```rust
128-
# let lines = "hello\nworld".lines();
128+
let lines = "hello\nworld".lines();
129+
129130
for (linenumber, line) in lines.enumerate() {
130131
println!("{}: {}", linenumber, line);
131132
}
@@ -134,10 +135,8 @@ for (linenumber, line) in lines.enumerate() {
134135
Outputs:
135136

136137
```text
137-
0: Content of line one
138-
1: Content of line two
139-
2: Content of line three
140-
3: Content of line four
138+
0: hello
139+
1: world
141140
```
142141

143142
## Ending iteration early

0 commit comments

Comments
 (0)