Merge the inline function/method assists into inline_call

This commit is contained in:
Lukas Wirth 2021-07-03 17:13:56 +02:00
parent 688398febc
commit 14e18bfa38
4 changed files with 47 additions and 90 deletions

View file

@ -338,7 +338,6 @@ pub fn arg_list(args: impl IntoIterator<Item = ast::Expr>) -> ast::ArgList {
}
pub fn ident_pat(ref_: bool, mut_: bool, name: ast::Name) -> ast::IdentPat {
use std::fmt::Write as _;
let mut s = String::from("fn f(");
if ref_ {
s.push_str("ref ");
@ -346,7 +345,7 @@ pub fn ident_pat(ref_: bool, mut_: bool, name: ast::Name) -> ast::IdentPat {
if mut_ {
s.push_str("mut ");
}
let _ = write!(s, "{}", name);
format_to!(s, "{}", name);
s.push_str(": ())");
ast_from_text(&s)
}