mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-14 14:13:58 +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.push(self_param.syntax().text().to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
res.extend(
|
res.extend(param_list.params().map(|param| {
|
||||||
param_list
|
param.pat().map(|pat| pat.syntax().text().to_string()).unwrap_or_default()
|
||||||
.params()
|
}));
|
||||||
.map(|param| param.pat().unwrap().syntax().text().to_string()),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
res
|
res
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue