mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 14:01:51 +00:00
14 lines
170 B
Rust
14 lines
170 B
Rust
//@ run-pass
|
|
|
|
fn test<F>(f: F) -> usize
|
|
where
|
|
F: FnOnce(usize) -> usize,
|
|
{
|
|
return f(22);
|
|
}
|
|
|
|
pub fn main() {
|
|
let y = test(|x| 4 * x);
|
|
assert_eq!(y, 88);
|
|
}
|