Skip to content

Commit ff263c8

Browse files
Merge pull request #511 from lk-chen/patch-2
编号显示错误
2 parents 9014c38 + 7841c21 commit ff263c8

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

iterator/iterator.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ let v = (1..20).collect(); //编译通不过的!
9595

9696
1. 显式地标明`v`的类型:
9797

98-
```rust
99-
let v: Vec<_> = (1..20).collect();
100-
```
98+
```rust
99+
let v: Vec<_> = (1..20).collect();
100+
```
101101

102102
2. 显式地指定`collect`调用时的类型:
103103

104-
```rust
105-
let v = (1..20).collect::<Vec<_>>();
106-
```
104+
```rust
105+
let v = (1..20).collect::<Vec<_>>();
106+
```
107107

108108
当然,一个迭代器中还存在其他的消费者,比如取第几个值所用的 `.nth()`函数,还有用来查找值的 `.find()` 函数,调用下一个值的`next()`函数等等,这里限于篇幅我们不能一一介绍。所以,下面我们只介绍另一个比较常用的消费者—— `fold` 。
109109

0 commit comments

Comments
 (0)