Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jonybur committed Oct 11, 2023
1 parent 77144c7 commit 31f5954
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tooling/nargo_fmt/src/visitor/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,18 @@ impl FmtVisitor<'_> {
.iter()
.map(|arg| {
let arg_str = self.format_expr(arg.clone()).trim().to_string();
if arg_str.contains('(') {
return arg_str.replace(" ,", ",").replace("( ", "(").replace(" )", ")");
if arg_str.contains('(') {
return arg_str
.replace(" ,", ",")
.replace("( ", "(")
.replace(" )", ")");
}
arg_str
})
.collect::<Vec<_>>()
.join(", ");
format!("{}.{}({})", formatted_object, method_call_expr.method_name, formatted_args)
}
}
ExpressionKind::MemberAccess(member_access_expr) => {
let lhs_str = self.format_expr(member_access_expr.lhs);
format!("{}.{}", lhs_str, member_access_expr.rhs)
Expand Down

0 comments on commit 31f5954

Please sign in to comment.