Skip to content

Commit

Permalink
issue #65 convert -> collect
Browse files Browse the repository at this point in the history
  • Loading branch information
stevedonovan committed Apr 17, 2018
1 parent 8275b64 commit a6453ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/5-stdlib-containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ either is a vector or an error:
```

And if there was a bad conversion? Then you would just get `Err` with the first
error encountered. It's a good example of how extremely flexible `convert` is.
error encountered. It's a good example of how extremely flexible `collect` is.
(The notation here can be intimidating - `Vec<_>` means "this is a vector, work
out the actual type for me` and `Result<Vec<_>,_>` is furthermore asking
Rust to work out the error type as well.)
Expand Down Expand Up @@ -449,7 +449,7 @@ vector to have the _boxed trait type_ before things just work:
```rust
let mut v: Vec<Box<Fn(f64)->f64>> = Vec::new();
```
We can now use the same trick and keep these boxed closures in a `HashMap`. We still
We can now use the same trick and keep these boxed closures in a `HashMap`. We still
have to watch out for lifetimes, since closures can borrow from their environment.

It's tempting as first to make them `FnMut` - that is, they can modify any captured variables. But we will
Expand Down
3 changes: 2 additions & 1 deletion src/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# A Gentle Introduction To Rust

![Rust](PPrustS.png)

[thanks to David Marino](http://leftoversalad.com/c/015_programmingpeople/)

## Why learn a new Programming Language?
Expand Down Expand Up @@ -107,5 +108,5 @@ I'd like to thank the many contributors who caught bad English or bad Rust for m
and thanks to David Marino for his cool characterization
of Rust as a friendly-but-hardcore no-nonsense knight in shining armour.

Steve Donovan © 2017 MIT license version 0.3.0
Steve Donovan © 2017-2018 MIT license version 0.4.0

0 comments on commit a6453ec

Please sign in to comment.