From 30817de3affd9376eed4ff164c42fe0e00a1ac37 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Mon, 4 May 2020 10:58:21 +0300 Subject: Code review fixes Co-authored-by: Edwin Cheng --- crates/ra_ide/src/inlay_hints.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'crates') diff --git a/crates/ra_ide/src/inlay_hints.rs b/crates/ra_ide/src/inlay_hints.rs index 79c6ff4e1..b391f903a 100644 --- a/crates/ra_ide/src/inlay_hints.rs +++ b/crates/ra_ide/src/inlay_hints.rs @@ -263,14 +263,13 @@ fn is_argument_similar_to_param_name( ) -> bool { if is_enum_name_similar_to_param_name(sema, argument, param_name) { return true; - } else { - let argument_string = if let Some(repr) = get_string_representation(argument) { - repr - } else { - return false; - }; - let argument_string = argument_string.trim_start_matches('_'); - argument_string.starts_with(param_name) || argument_string.ends_with(param_name) + } + match get_string_representation(argument) { + None => false, + Some(repr) => { + let argument_string = repr.trim_start_matches('_'); + argument_string.starts_with(param_name) || argument_string.ends_with(param_name) + } } } -- cgit v1.2.3