Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![feature(async_await)]
- #![feature(await_macro)]
- #![feature(futures_api)]
- async fn foo<F: FnMut(usize)>(mut callback: F) {
- callback(5);
- }
- fn main() {
- futures::executor::block_on(async {
- await!(foo(|v| println!("{:?}", v)));
- });
- }
- // [dependencies]
- // futures-preview = "0.3.0-alpha.11"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement