mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-28 23:19:11 +00:00
add [Iterator]
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user