mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-29 06:23:25 +00:00
remove unwarp on adt name
This commit is contained in:
parent
c735b979ed
commit
2137bdfca3
1 changed files with 5 additions and 3 deletions
|
@ -137,10 +137,12 @@ pub(super) fn add_call_parens<'b>(
|
|||
}
|
||||
None => {
|
||||
let name = match param.ty().as_adt() {
|
||||
Some(adt) => {
|
||||
to_lower_snake_case(&adt.name(ctx.db).as_text().unwrap())
|
||||
}
|
||||
None => "_".to_string(),
|
||||
Some(adt) => adt
|
||||
.name(ctx.db)
|
||||
.as_text()
|
||||
.map(to_lower_snake_case)
|
||||
.unwrap_or("_".to_string()),
|
||||
};
|
||||
f(&format_args!("${{{}:{}}}", index + offset, name))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue