From 5c11af1479a41263496f98096b20614c4b34250f Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 7 May 2024 11:35:49 -0400 Subject: [PATCH] `cargo fmt` --- helix-lsp/src/lib.rs | 2 +- helix-term/src/handlers/completion/resolve.rs | 4 +++- helix-term/src/handlers/signature_help.rs | 13 ++++++------- helix-vcs/src/git.rs | 4 ++-- helix-view/src/register.rs | 4 +++- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index 0a3c6a33d..ec89e1f82 100644 --- a/helix-lsp/src/lib.rs +++ b/helix-lsp/src/lib.rs @@ -678,7 +678,7 @@ impl Registry { pub fn remove_by_id(&mut self, id: LanguageServerId) { let Some(client) = self.inner.remove(id) else { log::error!("client was already removed"); - return + return; }; self.file_event_handler.remove_client(id); let instances = self diff --git a/helix-term/src/handlers/completion/resolve.rs b/helix-term/src/handlers/completion/resolve.rs index fb5179e13..6b70e52cd 100644 --- a/helix-term/src/handlers/completion/resolve.rs +++ b/helix-term/src/handlers/completion/resolve.rs @@ -111,7 +111,9 @@ impl AsyncHook for ResolveTimeout { } fn finish_debounce(&mut self) { - let Some(request) = self.next_request.take() else { return }; + let Some(request) = self.next_request.take() else { + return; + }; let (tx, rx) = helix_event::cancelation(); self.in_flight = Some((tx, request.item.clone())); tokio::spawn(request.execute(rx)); diff --git a/helix-term/src/handlers/signature_help.rs b/helix-term/src/handlers/signature_help.rs index 4fc008118..aaa97b9a0 100644 --- a/helix-term/src/handlers/signature_help.rs +++ b/helix-term/src/handlers/signature_help.rs @@ -119,8 +119,7 @@ pub fn request_signature_help( // Do not show the message if signature help was invoked // automatically on backspace, trigger characters, etc. if invoked == SignatureHelpInvoked::Manual { - editor - .set_error("No configured language server supports signature-help"); + editor.set_error("No configured language server supports signature-help"); } return; }; @@ -300,11 +299,11 @@ fn signature_help_post_insert_char_hook( let (view, doc) = current!(cx.editor); // TODO support multiple language servers (not just the first that is found), likely by merging UI somehow let Some(language_server) = doc - .language_servers_with_feature(LanguageServerFeature::SignatureHelp) - .next() - else { - return Ok(()); - }; + .language_servers_with_feature(LanguageServerFeature::SignatureHelp) + .next() + else { + return Ok(()); + }; let capabilities = language_server.capabilities(); diff --git a/helix-vcs/src/git.rs b/helix-vcs/src/git.rs index 979f8726e..78e582436 100644 --- a/helix-vcs/src/git.rs +++ b/helix-vcs/src/git.rs @@ -145,8 +145,8 @@ fn status(repo: &Repository, f: impl Fn(Result) -> bool) -> Result<( for item in status_iter { let Ok(item) = item.map_err(|err| f(Err(err.into()))) else { - continue; - }; + continue; + }; let change = match item { Item::Modification { rela_path, status, .. diff --git a/helix-view/src/register.rs b/helix-view/src/register.rs index a7f356121..166d2027d 100644 --- a/helix-view/src/register.rs +++ b/helix-view/src/register.rs @@ -233,7 +233,9 @@ fn read_from_clipboard<'a>( // If we're pasting the same values that we just yanked, re-use // the saved values. This allows pasting multiple selections // even when yanked to a clipboard. - let Some(values) = saved_values else { return RegisterValues::new(iter::once(contents.into())) }; + let Some(values) = saved_values else { + return RegisterValues::new(iter::once(contents.into())); + }; if contents_are_saved(values, &contents) { RegisterValues::new(values.iter().map(Cow::from).rev())