mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Simlify with matches!()
This commit is contained in:
parent
513924a7e0
commit
e75e2ae5b6
20 changed files with 32 additions and 98 deletions
|
@ -312,10 +312,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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue