refactor: replace async_runtime::block_on with AsyncHandler::block_on and add inline annotations

This commit is contained in:
Tunglies
2025-11-10 09:30:55 +08:00
parent 49e5a557ca
commit b308251022
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -12,6 +12,7 @@ impl AsyncHandler {
// async_runtime::handle()
// }
#[inline]
#[track_caller]
pub fn spawn<F, Fut>(f: F) -> JoinHandle<()>
where
@@ -23,6 +24,7 @@ impl AsyncHandler {
async_runtime::spawn(f())
}
#[inline]
#[track_caller]
pub fn spawn_blocking<T, F>(f: F) -> JoinHandle<T>
where
@@ -34,7 +36,7 @@ impl AsyncHandler {
async_runtime::spawn_blocking(f)
}
#[allow(dead_code)]
#[inline]
#[track_caller]
pub fn block_on<Fut>(fut: Fut) -> Fut::Output
where