Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Light bulb to add async to function #923

Open
vanillajonathan opened this issue Aug 26, 2021 · 0 comments
Open

Light bulb to add async to function #923

vanillajonathan opened this issue Aug 26, 2021 · 0 comments

Comments

@vanillajonathan
Copy link

await is only allowed inside async functions and blocks

only allowed inside async functions and blocksrustc(E0728)
main.rs(14, 8): this is not async
main.rs(15, 20): only allowed inside async functions and blocks

Show a light bulb that gives the user the option to add "async" to the function.

Before:

pub fn foo() {
    TcpListener::bind("127.0.0.1:8080").await?;
}

After:

pub async fn foo() {
    TcpListener::bind("127.0.0.1:8080").await?;
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant