fn test<T: Fn(u32)->u32>(closure:T) {
assert_eq!(closure(10), 11);
}
let closure = |x:u32|-> u32 {
x+1
};
test(closure);
あれ
2022/2/26 8:48:00
fn test<T: Fn(u32)->u32>(closure:T) {
assert_eq!(closure(10), 11);
}
let closure = |x:u32|-> u32 {
x+1
};
test(closure);