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

fn that returns a future and contains a single async block should be linted to use async fn instead #5503

Closed
khuey opened this issue Apr 21, 2020 · 0 comments · Fixed by #5576
Labels
A-lint Area: New lints E-medium Call for participation: Medium difficulty level problem and requires some initial experience. L-suggestion Lint: Improving, adding or fixing lint suggestions T-async-await Type: Issues related to async/await

Comments

@khuey
Copy link
Contributor

khuey commented Apr 21, 2020

Bounced over from rust-lang/rust#71391.

Something like

fn foo(args) -> impl Future<Output = u32> {
  async move {
    // Do stuff with args.
    my_u32
  }
}

async fn is strictly better.

@flip1995 flip1995 added L-suggestion Lint: Improving, adding or fixing lint suggestions E-medium Call for participation: Medium difficulty level problem and requires some initial experience. A-lint Area: New lints T-async-await Type: Issues related to async/await labels Apr 21, 2020
@bors bors closed this as completed in 78b7d49 May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints E-medium Call for participation: Medium difficulty level problem and requires some initial experience. L-suggestion Lint: Improving, adding or fixing lint suggestions T-async-await Type: Issues related to async/await
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants