Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async support cannot handle generators as arguments or returns from non-async functions #136

Open
JustusAdam opened this issue Mar 30, 2024 · 0 comments

Comments

@JustusAdam
Copy link
Collaborator

JustusAdam commented Mar 30, 2024

For instance

bla.map(|..| async { .. }).unwrap().await

Or another example from Hyperswitch

pub async fn time_future<F, R>(future: F) -> (R, time::Duration)
where
    F: futures::Future<Output = R>,
{
    let start = time::Instant::now();
    let result = future.await;
    let time_spent = start.elapsed();
    (result, time_spent)
}
@JustusAdam JustusAdam changed the title Async support cannot handle generators created in nested functions Async support cannot handle generators as arguments or returns from non-async functions Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant