Skip to content

Commit 596f1ec

Browse files
committed
migrate needs_parens_in_call to use SyntaxFactory
1 parent 7be5b5e commit 596f1ec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/ide-assists/src/utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ pub(crate) fn wrap_paren(expr: ast::Expr, make: &SyntaxFactory, prec: ExprPreced
103103
}
104104

105105
pub(crate) fn wrap_paren_in_call(expr: ast::Expr, make: &SyntaxFactory) -> ast::Expr {
106-
if needs_parens_in_call(&expr) { make.expr_paren(expr).into() } else { expr }
106+
if needs_parens_in_call(make, &expr) { make.expr_paren(expr).into() } else { expr }
107107
}
108108

109-
fn needs_parens_in_call(param: &ast::Expr) -> bool {
110-
let call = make::expr_call(make::ext::expr_unit(), make::arg_list(Vec::new()));
109+
fn needs_parens_in_call(make: &SyntaxFactory, param: &ast::Expr) -> bool {
110+
let call = make.expr_call(make.expr_unit(), make.arg_list(Vec::new()));
111111
let callable = call.expr().expect("invalid make call");
112112
param.needs_parens_in_place_of(call.syntax(), callable.syntax())
113113
}

0 commit comments

Comments
 (0)