18 lines
328 B
Rust
18 lines
328 B
Rust
//@ aux-build:block-on.rs
|
|
//@ edition:2021
|
|
//@ build-pass
|
|
|
|
#![feature(async_closure)]
|
|
|
|
extern crate block_on;
|
|
|
|
fn wrapper(f: impl Fn(String)) -> impl async Fn(String) {
|
|
async move |s| f(s)
|
|
}
|
|
|
|
fn main() {
|
|
block_on::block_on(async {
|
|
wrapper(|who| println!("Hello, {who}!"))(String::from("world")).await;
|
|
});
|
|
}
|