diff options
author | Lukas Wirth <[email protected]> | 2020-10-14 20:40:51 +0100 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2020-10-15 17:31:33 +0100 |
commit | bc11475a2a0f06d5083a7032764a50e5f8ade130 (patch) | |
tree | bc9f1fde67ad95fbd8061779469897576f233cc3 /crates/syntax/src | |
parent | d983f18df7dd484ec43510111169180d7abe038d (diff) |
Properly qualify trait methods in qualify_path assist
Diffstat (limited to 'crates/syntax/src')
-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 | } |