Skip to content

async { <FUTURE_EXPR>.await } can be reduced to <FUTURE_EXPR> #10444

@frewsxcv

Description

@frewsxcv

What it does

Awaiting a Future a future in a new async block is the same as just using the future directly. I think?

Lint Name

redundant_async_block

Category

style, complexity

Advantage

No response

Drawbacks

No response

Example

block_on(async { my_future.await })

Could be written as:

block_on(my_future)
### Tasks 

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions