Migrate extract_type_alias to mutable ast

This commit is contained in:
DropDemBits 2023-06-04 23:30:48 -04:00
parent e6e72bf9d5
commit dd5f05590e
No known key found for this signature in database
GPG key ID: 7FE02A6C1EDFA075
2 changed files with 30 additions and 23 deletions

View file

@ -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()));
}
}