2024-10-16 16:09:41 -04:00
|
|
|
//@ edition: 2021
|
|
|
|
|
|
|
|
//@ aux-build: executor.rs
|
|
|
|
extern crate executor;
|
|
|
|
|
2024-11-04 19:29:02 +00:00
|
|
|
async fn call_once(f: impl AsyncFnOnce()) {
|
2024-10-16 16:09:41 -04:00
|
|
|
f().await;
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
let async_closure = async || {};
|
|
|
|
executor::block_on(async_closure());
|
|
|
|
executor::block_on(call_once(async_closure));
|
|
|
|
}
|