6931: Minor, cleanup API r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2020-12-18 16:50:26 +00:00 committed by GitHub
commit 150ea3a61f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -145,7 +145,7 @@ impl FunctionBuilder {
self.type_params,
self.params,
fn_body,
Some(make::ret_type(make::ty("()"))),
Some(make::ret_type(make::ty_unit())),
);
let leading_ws;
let trailing_ws;

View file

@ -20,6 +20,9 @@ pub fn name_ref(text: &str) -> ast::NameRef {
pub fn ty(text: &str) -> ast::Type {
ast_from_text(&format!("impl {} for D {{}};", text))
}
pub fn ty_unit() -> ast::Type {
ty("()")
}
pub fn assoc_item_list() -> ast::AssocItemList {
ast_from_text("impl C for D {};")