Fix handling of spaces after for as

This commit is contained in:
JRI98 2024-07-03 14:38:46 +01:00
parent 3abc276937
commit 25084b18ec
No known key found for this signature in database
GPG key ID: F83B29916FF13F24
3 changed files with 35 additions and 8 deletions

View file

@ -7,11 +7,8 @@ When(
patterns: [
@14-20 SpaceBefore(
As(
@14-15 SpaceAfter(
Underscore(
"",
),
[],
@14-15 Underscore(
"",
),
PatternAs {
spaces_before: [],

View file

@ -6113,6 +6113,31 @@ mod test_fmt {
);
}
#[test]
fn issue_6215() {
expr_formats_to(
indoc!(
r"
when list is
[first as last]
| [first, last] ->
first
_->Not
"
),
indoc!(
r"
when list is
[first as last]
| [first, last] ->
first
_ -> Not
"
),
);
}
// this is a parse error atm
// #[test]
// fn multiline_apply() {