refactor: use generate_trait_impl_text_intransitive for From-like traits

This commit is contained in:
rami3l 2022-12-14 20:08:20 +08:00
parent 12b05d2416
commit cfa914958c
4 changed files with 44 additions and 28 deletions

View file

@ -734,8 +734,8 @@ pub fn type_bound_list(
}
pub fn type_param(name: ast::Name, bounds: Option<ast::TypeBoundList>) -> ast::TypeParam {
let bound = bounds.map_or_else(String::new, |it| format!(": {it}"));
ast_from_text(&format!("fn f<{name}{bound}>() {{ }}"))
let bounds = bounds.map_or_else(String::new, |it| format!(": {it}"));
ast_from_text(&format!("fn f<{name}{bounds}>() {{ }}"))
}
pub fn lifetime_param(lifetime: ast::Lifetime) -> ast::LifetimeParam {