Skip to content

Commit

Permalink
Merge pull request #511 from lk-chen/patch-2
Browse files Browse the repository at this point in the history
编号显示错误
  • Loading branch information
MarisaKirisame authored Jun 18, 2016
2 parents 9014c38 + 7841c21 commit ff263c8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions iterator/iterator.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ let v = (1..20).collect(); //编译通不过的!

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

```rust
let v: Vec<_> = (1..20).collect();
```
```rust
let v: Vec<_> = (1..20).collect();
```

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

```rust
let v = (1..20).collect::<Vec<_>>();
```
```rust
let v = (1..20).collect::<Vec<_>>();
```

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

Expand Down

0 comments on commit ff263c8

Please sign in to comment.