add [Iterator]

This commit is contained in:
sunface
2022-03-31 16:43:23 +08:00
parent 562eb9247f
commit 218b13c03c
4 changed files with 561 additions and 15 deletions

View File

@ -186,7 +186,7 @@ fn exec<'a, F: __>(mut f: F) {
}
```
#### How does the compiler determine the trait
#### Which trait does the compiler prefer to use?
- Fn: the closure uses the captured value by reference (&T)
- FnMut: the closure uses the captured value by mutable reference (&mut T)
- FnOnce: the closure uses the captured value by value (T)