Skip to content

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

@JustusAdam

Description

@JustusAdam

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)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions