aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/assists/src/handlers/generate_function.rs2
-rw-r--r--crates/syntax/src/ast/make.rs3
2 files changed, 4 insertions, 1 deletions
diff --git a/crates/assists/src/handlers/generate_function.rs b/crates/assists/src/handlers/generate_function.rs
index 758188a42..f4cf155b6 100644
--- a/crates/assists/src/handlers/generate_function.rs
+++ b/crates/assists/src/handlers/generate_function.rs
@@ -145,7 +145,7 @@ impl FunctionBuilder {
145 self.type_params, 145 self.type_params,
146 self.params, 146 self.params,
147 fn_body, 147 fn_body,
148 Some(make::ret_type(make::ty("()"))), 148 Some(make::ret_type(make::ty_unit())),
149 ); 149 );
150 let leading_ws; 150 let leading_ws;
151 let trailing_ws; 151 let trailing_ws;
diff --git a/crates/syntax/src/ast/make.rs b/crates/syntax/src/ast/make.rs
index 16b079c42..ba7e5d2fb 100644
--- a/crates/syntax/src/ast/make.rs
+++ b/crates/syntax/src/ast/make.rs
@@ -20,6 +20,9 @@ pub fn name_ref(text: &str) -> ast::NameRef {
20pub fn ty(text: &str) -> ast::Type { 20pub fn ty(text: &str) -> ast::Type {
21 ast_from_text(&format!("impl {} for D {{}};", text)) 21 ast_from_text(&format!("impl {} for D {{}};", text))
22} 22}
23pub fn ty_unit() -> ast::Type {
24 ty("()")
25}
23 26
24pub fn assoc_item_list() -> ast::AssocItemList { 27pub fn assoc_item_list() -> ast::AssocItemList {
25 ast_from_text("impl C for D {};") 28 ast_from_text("impl C for D {};")