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:
Sergey Kaunov
2023-05-13 11:42:55 +03:00
committed by GitHub
parent 06b48b24b3
commit 0f9f0367d6

View File

@ -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));
@ -293,4 +293,4 @@ fn factory(x:i32) -> Box<dyn Fn(i32) -> i32> {
} }
fn main() {} fn main() {}
``` ```