diff options
Diffstat (limited to 'crates/syntax')
-rw-r--r-- | crates/syntax/src/ast/make.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/syntax/src/ast/make.rs b/crates/syntax/src/ast/make.rs index 74dbdfaf7..5b06cb767 100644 --- a/crates/syntax/src/ast/make.rs +++ b/crates/syntax/src/ast/make.rs | |||
@@ -172,6 +172,9 @@ pub fn expr_call(f: ast::Expr, arg_list: ast::ArgList) -> ast::Expr { | |||
172 | pub fn expr_method_call(receiver: ast::Expr, method: &str, arg_list: ast::ArgList) -> ast::Expr { | 172 | pub fn expr_method_call(receiver: ast::Expr, method: &str, arg_list: ast::ArgList) -> ast::Expr { |
173 | expr_from_text(&format!("{}.{}{}", receiver, method, arg_list)) | 173 | expr_from_text(&format!("{}.{}{}", receiver, method, arg_list)) |
174 | } | 174 | } |
175 | pub fn expr_ref(expr: ast::Expr, exclusive: bool) -> ast::Expr { | ||
176 | expr_from_text(&if exclusive { format!("&mut {}", expr) } else { format!("&{}", expr) }) | ||
177 | } | ||
175 | fn expr_from_text(text: &str) -> ast::Expr { | 178 | fn expr_from_text(text: &str) -> ast::Expr { |
176 | ast_from_text(&format!("const C: () = {};", text)) | 179 | ast_from_text(&format!("const C: () = {};", text)) |
177 | } | 180 | } |