mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Merge #5105
5105: Simlify with matches!() r=matklad a=Veetaha Co-authored-by: Veetaha <veetaha2@gmail.com>
This commit is contained in:
commit
ca31b1d63a
20 changed files with 44 additions and 119 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue