mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
refactor: use generate_trait_impl_text_intransitive
for From
-like traits
This commit is contained in:
parent
12b05d2416
commit
cfa914958c
4 changed files with 44 additions and 28 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue