mirror of
https://github.com/rust-lang/rust
synced 2024-09-05 16:57:03 +00:00
7 lines
188 B
Rust
7 lines
188 B
Rust
//@ run-pass
|
|
|
|
pub fn main() {
|
|
fn as_buf<T, F>(s: String, f: F) -> T where F: FnOnce(String) -> T { f(s) }
|
|
as_buf("foo".to_string(), |foo: String| -> () { println!("{}", foo) });
|
|
}
|