We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8be3f25 commit cd4a7bfCopy full SHA for cd4a7bf
crates/assists/src/handlers/generate_function.rs
@@ -145,7 +145,7 @@ impl FunctionBuilder {
145
self.type_params,
146
self.params,
147
fn_body,
148
- Some(make::ret_type(make::ty("()"))),
+ Some(make::ret_type(make::ty_unit())),
149
);
150
let leading_ws;
151
let trailing_ws;
crates/syntax/src/ast/make.rs
@@ -20,6 +20,9 @@ pub fn name_ref(text: &str) -> ast::NameRef {
20
pub fn ty(text: &str) -> ast::Type {
21
ast_from_text(&format!("impl {} for D {{}};", text))
22
}
23
+pub fn ty_unit() -> ast::Type {
24
+ ty("()")
25
+}
26
27
pub fn assoc_item_list() -> ast::AssocItemList {
28
ast_from_text("impl C for D {};")
0 commit comments