Fix return backpassing case

This commit is contained in:
Joshua Warner 2024-12-13 13:36:14 -08:00
parent d56b6b7b20
commit 2389040b39
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 43 additions and 2 deletions

View file

@ -1683,14 +1683,16 @@ fn fmt_return<'a>(
after_return: &Option<&'a Loc<Expr<'a>>>,
parens: Parens,
newlines: Newlines,
indent: u16,
) {
buf.ensure_ends_with_newline();
buf.indent(indent);
buf.push_str(keyword::RETURN);
if matches!(return_value.value.extract_spaces().item, Expr::Defs(..)) {
if matches!(
return_value.value.extract_spaces().item,
Expr::Defs(..) | Expr::Backpassing(..)
) {
buf.ensure_ends_with_newline();
} else {
buf.spaces(1);