mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 20:49:41 +00:00
Update solution closure.md
Changed order of bounds so that readers new to Rust won't be confused by "bool + Copy" and could comprehend it faster and better.
This commit is contained in:
@ -118,7 +118,7 @@ fn main() {
|
|||||||
```rust
|
```rust
|
||||||
fn fn_once<F>(func: F)
|
fn fn_once<F>(func: F)
|
||||||
where
|
where
|
||||||
F: FnOnce(usize) -> bool + Copy,// 改动在这里
|
F: Copy + FnOnce(usize) -> bool,// 改动在这里
|
||||||
{
|
{
|
||||||
println!("{}", func(3));
|
println!("{}", func(3));
|
||||||
println!("{}", func(4));
|
println!("{}", func(4));
|
||||||
|
Reference in New Issue
Block a user