Skip to content

Instantly share code, notes, and snippets.

Created September 14, 2016 08:53
Show Gist options
  • Save anonymous/4786218478068b7fd129558bc5ca414d to your computer and use it in GitHub Desktop.
Save anonymous/4786218478068b7fd129558bc5ca414d to your computer and use it in GitHub Desktop.
Shared via Rust Playground
fn bar<F, R>(f: F) -> R where F: FnOnce() -> R {
//f(); // used after move
f() // need to get R somehow
}
fn main() {
bar(|| {
println!("foo!");
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment