mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Replace if let
with match
where appropriate
This commit is contained in:
parent
f29796da61
commit
9583dd5725
44 changed files with 201 additions and 269 deletions
|
@ -641,9 +641,14 @@ pub fn fn_(
|
|||
ret_type: Option<ast::RetType>,
|
||||
is_async: bool,
|
||||
) -> ast::Fn {
|
||||
let type_params =
|
||||
if let Some(type_params) = type_params { format!("<{}>", type_params) } else { "".into() };
|
||||
let ret_type = if let Some(ret_type) = ret_type { format!("{} ", ret_type) } else { "".into() };
|
||||
let type_params = match type_params {
|
||||
Some(type_params) => format!("<{}>", type_params),
|
||||
None => "".into(),
|
||||
};
|
||||
let ret_type = match ret_type {
|
||||
Some(ret_type) => format!("{} ", ret_type),
|
||||
None => "".into(),
|
||||
};
|
||||
let visibility = match visibility {
|
||||
None => String::new(),
|
||||
Some(it) => format!("{} ", it),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue