Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn foo(bar: for<'a> Fn(&'a str) -> (impl (Fn() -> String) + 'a)) -> String {
- let baz = "hello".to_owned();
- bar(&baz)()
- }
- fn main() {
- println!("{}", foo(|qux| move || qux.to_owned() + " world"));
- }
Add Comment
Please, Sign In to add comment