mirror of
https://git.proxmox.com/git/rustc
synced 2025-08-15 10:19:00 +00:00
16 lines
299 B
Rust
16 lines
299 B
Rust
//@ aux-build:block-on.rs
|
|
//@ edition:2021
|
|
//@ build-pass
|
|
|
|
extern crate block_on;
|
|
|
|
fn wrapper(f: impl Fn(String)) -> impl AsyncFn(String) {
|
|
async move |s| f(s)
|
|
}
|
|
|
|
fn main() {
|
|
block_on::block_on(async {
|
|
wrapper(|who| println!("Hello, {who}!"))(String::from("world")).await;
|
|
});
|
|
}
|