Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion crates/fmt/src/state/sol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2184,7 +2184,9 @@ impl<'ast> State<'_, 'ast> {
}
self.print_word("{");
self.end();
self.print_trailing_comment_no_break(catch_span.lo(), None);
if !block.is_empty() {
self.print_trailing_comment_no_break(catch_span.lo(), None);
}
self.print_block_without_braces(block, catch_span.hi(), Some(self.ind));
if self.cursor.enabled || self.cursor.pos < try_span.hi() {
self.print_word("}");
Expand Down
2 changes: 1 addition & 1 deletion crates/fmt/testdata/TryStatement/fmt.sol
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,6 @@ contract TryStatement {
uint80, int256 _price, uint256, uint256 _updatedAt, uint80
) {
return true;
} catch {}
} catch {} // trailing cmnt
}
}
2 changes: 1 addition & 1 deletion crates/fmt/testdata/TryStatement/original.sol
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ contract TryStatement {
function try_reallyLongCall() {
try AggregatorV3Interface(oracle).latestRoundData() returns (uint80, int256 _price, uint256, uint256 _updatedAt, uint80) {
return true;
} catch {}
} catch {} // trailing cmnt
}
}
Loading