formatter: fix indentation for multi-line lambdas in pipeline expression

This commit is contained in:
Sean Hagstrom 2022-05-24 10:58:18 +01:00
parent 802cf20637
commit d9d708fc94
No known key found for this signature in database
GPG key ID: AA9814E95B301A5C
3 changed files with 64 additions and 6 deletions

View file

@ -145,7 +145,10 @@ impl<'a> Formattable for Expr<'a> {
}
let next_indent = if starts_with_newline(sub_expr) || should_add_newlines {
indent + INDENT
match sub_expr {
Expr::Closure(..) | Expr::SpaceAfter(Closure(..), ..) => indent,
_ => indent + INDENT,
}
} else {
indent
};