rustfmt is not indenting method calls by default in some cases.
Is there some configuration to make rustfmt indent the struct method call.
Default behavior:
fn foo() {
query(
r#"
...
"#,
)
.bind()
.execute()
.await?;
statement_start_unclear_visually();
}
Expected behavior:
fn foo() {
query(
r#"
...
"#,
)
.bind()
.execute()
.await?;
statement_start_clear_visually();
}
Note: This behavior happens when the expression for the struct is multiline. If struct expression query(...)
is in one line then indentation behavior for method call is ok.
Rust Playground link.