From d854ad8f279e5a3a4b3908bf5b0afdaba3d37bc9 Mon Sep 17 00:00:00 2001 From: imtsuki Date: Wed, 15 Jan 2020 09:30:19 +0800 Subject: FnSignature: use unwrap_or_default for parameter_name_list Signed-off-by: imtsuki --- crates/ra_ide/src/display/function_signature.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'crates/ra_ide/src') diff --git a/crates/ra_ide/src/display/function_signature.rs b/crates/ra_ide/src/display/function_signature.rs index b0eb1f194..ddc53a52b 100644 --- a/crates/ra_ide/src/display/function_signature.rs +++ b/crates/ra_ide/src/display/function_signature.rs @@ -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 } -- cgit v1.2.3