Replace if let with match where appropriate

This commit is contained in:
Aramis Razzaghipour 2021-10-03 23:53:01 +11:00
parent f29796da61
commit 9583dd5725
No known key found for this signature in database
GPG key ID: F788F7E990136003
44 changed files with 201 additions and 269 deletions

View file

@ -427,10 +427,9 @@ pub(crate) fn handle_workspace_symbol(
// If no explicit marker was set, check request params. If that's also empty
// use global config.
if !all_symbols {
let search_kind = if let Some(ref search_kind) = params.search_kind {
search_kind
} else {
&config.search_kind
let search_kind = match params.search_kind {
Some(ref search_kind) => search_kind,
None => &config.search_kind,
};
all_symbols = match search_kind {
lsp_ext::WorkspaceSymbolSearchKind::OnlyTypes => false,
@ -439,10 +438,9 @@ pub(crate) fn handle_workspace_symbol(
}
if !libs {
let search_scope = if let Some(ref search_scope) = params.search_scope {
search_scope
} else {
&config.search_scope
let search_scope = match params.search_scope {
Some(ref search_scope) => search_scope,
None => &config.search_scope,
};
libs = match search_scope {
lsp_ext::WorkspaceSymbolSearchScope::Workspace => false,