mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Migrate extract_type_alias
to mutable ast
This commit is contained in:
parent
e6e72bf9d5
commit
dd5f05590e
2 changed files with 30 additions and 23 deletions
|
@ -166,7 +166,7 @@ pub fn ty_alias(
|
|||
assignment: Option<(ast::Type, Option<ast::WhereClause>)>,
|
||||
) -> ast::TypeAlias {
|
||||
let mut s = String::new();
|
||||
s.push_str(&format!("type {} ", ident));
|
||||
s.push_str(&format!("type {}", ident));
|
||||
|
||||
if let Some(list) = generic_param_list {
|
||||
s.push_str(&list.to_string());
|
||||
|
@ -182,9 +182,9 @@ pub fn ty_alias(
|
|||
|
||||
if let Some(exp) = assignment {
|
||||
if let Some(cl) = exp.1 {
|
||||
s.push_str(&format!("= {} {}", &exp.0.to_string(), &cl.to_string()));
|
||||
s.push_str(&format!(" = {} {}", &exp.0.to_string(), &cl.to_string()));
|
||||
} else {
|
||||
s.push_str(&format!("= {}", &exp.0.to_string()));
|
||||
s.push_str(&format!(" = {}", &exp.0.to_string()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue