Skip to content

Do not break .await in method chains #6715

@RGBCube

Description

@RGBCube

Input:

let foo = foo.bar().await.biz().await.baz().await;

Desired output:

let foo = foo
  .bar().await
  .biz().await
  .baz().await;

Current output:

let foo = foo
  .bar()
  .await
  .biz()
  .await
  .baz()
  .await;

A nightly (or even stable 👀) option to get the Desired output would be really nice. Justification for this is there rarely is anything to do other than .await for the vast majority of async methods, and a newline is extra noise. Putting the .await on the same line signifies a stronger tie to the method and makes it easier to shuffle them around by shifting lines.

I'm willing to work on this, just curious if it has any chance of getting merged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-call-chainsArea: method call chainsneeds-triageThis issue or PR needs triaging to determine its status. Remove label once sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions