diff options
author | Philipp Mildenberger | 2023-03-19 23:08:24 +0000 |
---|---|---|
committer | Philipp Mildenberger | 2023-05-18 19:58:17 +0000 |
commit | 8ab6d7be5e1b6f36215820ef616c2a9feb2306fa (patch) | |
tree | 8716bbca03440815478c81981b80f792dc830d6a /helix-term/src/commands/typed.rs | |
parent | 1d5d5dab4718b9db40a20037c1cb1edf66f7991a (diff) |
Use let else instead of variable and fix some error messages
Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
Diffstat (limited to 'helix-term/src/commands/typed.rs')
-rw-r--r-- | helix-term/src/commands/typed.rs | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index 8cfc9fd2..9ab2aa4f 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -1330,23 +1330,19 @@ fn lsp_workspace_command( return Ok(()); } let doc = doc!(cx.editor); - let id_options = doc + let Some((language_server_id, options)) = doc .language_servers_with_feature(LanguageServerFeature::WorkspaceCommand) .find_map(|ls| { ls.capabilities() .execute_command_provider .as_ref() .map(|options| (ls.id(), options)) - }); - - let (language_server_id, options) = match id_options { - Some(id_options) => id_options, - None => { - cx.editor.set_status( - "No active language servers for this document support workspace commands", - ); - return Ok(()); - } + }) + else { + cx.editor.set_status( + "No active language servers for this document support workspace commands", + ); + return Ok(()); }; if args.is_empty() { |