Skip to content

Commit cd4a7bf

Browse files
committed
Minor, cleanup API
1 parent 8be3f25 commit cd4a7bf

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

crates/assists/src/handlers/generate_function.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl FunctionBuilder {
145145
self.type_params,
146146
self.params,
147147
fn_body,
148-
Some(make::ret_type(make::ty("()"))),
148+
Some(make::ret_type(make::ty_unit())),
149149
);
150150
let leading_ws;
151151
let trailing_ws;

crates/syntax/src/ast/make.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ pub fn name_ref(text: &str) -> ast::NameRef {
2020
pub fn ty(text: &str) -> ast::Type {
2121
ast_from_text(&format!("impl {} for D {{}};", text))
2222
}
23+
pub fn ty_unit() -> ast::Type {
24+
ty("()")
25+
}
2326

2427
pub fn assoc_item_list() -> ast::AssocItemList {
2528
ast_from_text("impl C for D {};")

0 commit comments

Comments
 (0)