Code review fixes

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
This commit is contained in:
Kirill Bulatov 2020-05-04 10:58:21 +03:00
parent 66882f1a24
commit 30817de3af

View File

@ -263,14 +263,13 @@ fn is_argument_similar_to_param_name(
) -> bool { ) -> bool {
if is_enum_name_similar_to_param_name(sema, argument, param_name) { if is_enum_name_similar_to_param_name(sema, argument, param_name) {
return true; return true;
} else { }
let argument_string = if let Some(repr) = get_string_representation(argument) { match get_string_representation(argument) {
repr None => false,
} else { Some(repr) => {
return false; let argument_string = repr.trim_start_matches('_');
}; argument_string.starts_with(param_name) || argument_string.ends_with(param_name)
let argument_string = argument_string.trim_start_matches('_'); }
argument_string.starts_with(param_name) || argument_string.ends_with(param_name)
} }
} }