diff options
author | Fedor Sakharov <[email protected]> | 2020-05-14 08:14:04 +0100 |
---|---|---|
committer | Fedor Sakharov <[email protected]> | 2020-05-14 08:14:04 +0100 |
commit | 7e9396c7ebd8b6b245086c2292e100200c8adb19 (patch) | |
tree | fe033c4dbe2a86e2f3bbf57945af20a4f5d7f8f6 | |
parent | a55ad203888b5e43cf6cbf015d562d7bd1abe0bb (diff) |
Change type_arg to type_ref func
-rw-r--r-- | crates/ra_assists/src/ast_transform.rs | 3 | ||||
-rw-r--r-- | crates/ra_syntax/src/ast/make.rs | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_assists/src/ast_transform.rs b/crates/ra_assists/src/ast_transform.rs index 4001ca73c..18f3ec683 100644 --- a/crates/ra_assists/src/ast_transform.rs +++ b/crates/ra_assists/src/ast_transform.rs | |||
@@ -64,12 +64,11 @@ impl<'a> SubstituteTypeParams<'a> { | |||
64 | let default = k.default(source_scope.db)?; | 64 | let default = k.default(source_scope.db)?; |
65 | Some(( | 65 | Some(( |
66 | k, | 66 | k, |
67 | ast::make::type_arg( | 67 | ast::make::type_ref( |
68 | &default | 68 | &default |
69 | .display_source_code(source_scope.db, source_scope.module()?.into()) | 69 | .display_source_code(source_scope.db, source_scope.module()?.into()) |
70 | .ok()?, | 70 | .ok()?, |
71 | ) | 71 | ) |
72 | .type_ref()?, | ||
73 | )) | 72 | )) |
74 | } | 73 | } |
75 | }) | 74 | }) |
diff --git a/crates/ra_syntax/src/ast/make.rs b/crates/ra_syntax/src/ast/make.rs index 8981cbe33..d0e960fb4 100644 --- a/crates/ra_syntax/src/ast/make.rs +++ b/crates/ra_syntax/src/ast/make.rs | |||
@@ -13,8 +13,8 @@ pub fn name_ref(text: &str) -> ast::NameRef { | |||
13 | ast_from_text(&format!("fn f() {{ {}; }}", text)) | 13 | ast_from_text(&format!("fn f() {{ {}; }}", text)) |
14 | } | 14 | } |
15 | 15 | ||
16 | pub fn type_arg(text: &str) -> ast::TypeArg { | 16 | pub fn type_ref(text: &str) -> ast::TypeRef { |
17 | ast_from_text(&format!("impl F<{}> for G {{}}", text)) | 17 | ast_from_text(&format!("impl {} for D {{}};", text)) |
18 | } | 18 | } |
19 | 19 | ||
20 | pub fn path_segment(name_ref: ast::NameRef) -> ast::PathSegment { | 20 | pub fn path_segment(name_ref: ast::NameRef) -> ast::PathSegment { |