Skip to content

Commit

Permalink
fix: Return false if if statement doesn't fit on single line
Browse files Browse the repository at this point in the history
  • Loading branch information
grandizzy committed Aug 30, 2024
1 parent c3eee61 commit 0c413ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/fmt/src/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ impl<'a, W: Write> Formatter<'a, W> {
})?;

write_chunk!(self, "}}")?;
return Ok(true)
return Ok(false)
}

// Determine writable statements by excluding statements from disabled start / end lines.
Expand Down
3 changes: 1 addition & 2 deletions crates/fmt/testdata/Repros/fmt.sol
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ contract IfElseTest {
number = 1;
} else if (newNumber = 2) {
// number = 2;
}
else {
} else {
newNumber = 3;
}
}
Expand Down

0 comments on commit 0c413ab

Please sign in to comment.