mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 21:54:42 +00:00
FnSignature: use unwrap_or_default for parameter_name_list
Signed-off-by: imtsuki <me@qjx.app>
This commit is contained in:
parent
d78a3cb638
commit
d854ad8f27
1 changed files with 3 additions and 5 deletions
|
@ -169,11 +169,9 @@ impl From<&'_ ast::FnDef> for FunctionSignature {
|
|||
res.push(self_param.syntax().text().to_string())
|
||||
}
|
||||
|
||||
res.extend(
|
||||
param_list
|
||||
.params()
|
||||
.map(|param| param.pat().unwrap().syntax().text().to_string()),
|
||||
);
|
||||
res.extend(param_list.params().map(|param| {
|
||||
param.pat().map(|pat| pat.syntax().text().to_string()).unwrap_or_default()
|
||||
}));
|
||||
}
|
||||
res
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue