5105: Simlify with matches!() r=matklad a=Veetaha



Co-authored-by: Veetaha <veetaha2@gmail.com>
This commit is contained in:
bors[bot] 2020-06-28 22:37:25 +00:00 committed by GitHub
commit ca31b1d63a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 44 additions and 119 deletions

View file

@ -313,10 +313,8 @@ fn get_string_representation(expr: &ast::Expr) -> Option<String> {
}
fn is_obvious_param(param_name: &str) -> bool {
let is_obvious_param_name = match param_name {
"predicate" | "value" | "pat" | "rhs" | "other" => true,
_ => false,
};
let is_obvious_param_name =
matches!(param_name, "predicate" | "value" | "pat" | "rhs" | "other");
param_name.len() == 1 || is_obvious_param_name
}