vscode-rust
vscode-rust copied to clipboard
Light bulb to add async to function
awaitis only allowed insideasyncfunctions and blocksonly allowed inside
asyncfunctions and blocksrustc(E0728) main.rs(14, 8): this is notasyncmain.rs(15, 20): only allowed insideasyncfunctions 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?;
}