Skip to content

Commit 927ada3

Browse files
committed
Fix typo in impl_trait.md
1 parent 291e2bc commit 927ada3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/trait/impl_trait.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn parse_csv_document<R: std::io::BufRead>(src: R) -> std::io::Result<Vec<Vec<St
2828
```
2929

3030
`parse_csv_document` is generic, allowing it to take any type which implements BufRead, such as `BufReader<File>` or `[u8]`,
31-
but it's not important what type `R` is, and `R` is only used to declare the type of `src`, so the function can also be written an
31+
but it's not important what type `R` is, and `R` is only used to declare the type of `src`, so the function can also be written as:
3232

3333
```rust,editable
3434
fn parse_csv_document(src: impl std::io::BufRead) -> std::io::Result<Vec<Vec<String>>> {
@@ -46,7 +46,7 @@ fn parse_csv_document(src: impl std::io::BufRead) -> std::io::Result<Vec<Vec<Str
4646
}
4747
```
4848

49-
Note that using `impl Trait` as an argument type means that you cannot explicitly state what form of the function you use, i.e. `parse_csv_document::<std::io::Empty>(std::io::empty())` will not work with the second example
49+
Note that using `impl Trait` as an argument type means that you cannot explicitly state what form of the function you use, i.e. `parse_csv_document::<std::io::Empty>(std::io::empty())` will not work with the second example.
5050

5151

5252
## As a return type

0 commit comments

Comments
 (0)