Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tooling/nargo_fmt/src/formatter/expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,7 @@

// Add a trailing comma regardless of whether the user specified one or not
group.text(self.chunk(|formatter| {
formatter.skip_comments_and_whitespace();
if formatter.token == Token::Comma {
formatter.write_current_token_and_bump();
} else {
Expand Down Expand Up @@ -2486,7 +2487,7 @@

#[test]
fn format_match() {
let src = "fn main() { match x { A=>B,C => {D}E=>(), } }";
let src = "fn main() { match x { A=>B , C => {D}E=>() , } }";
// We should remove the block on D for single expressions in the future,
// unless D is an if or match.
let expected = "fn main() {
Expand Down Expand Up @@ -2633,7 +2634,7 @@
fn regression_9556() {
let src = r#"fn foo() {
let x = a()
.bcde(fghijk

Check warning on line 2637 in tooling/nargo_fmt/src/formatter/expression.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (fghijk)

Check warning on line 2637 in tooling/nargo_fmt/src/formatter/expression.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (bcde)
);
x
}
Expand Down
Loading