From 6db63d46326c7845fa541aac9ec3e83d31c789e6 Mon Sep 17 00:00:00 2001 From: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com> Date: Mon, 23 Dec 2024 13:41:28 +0000 Subject: [PATCH] refactor: use let else statement --- helix-term/src/commands/lsp.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs index 47c4be20..d19f021b 100644 --- a/helix-term/src/commands/lsp.rs +++ b/helix-term/src/commands/lsp.rs @@ -1461,9 +1461,8 @@ fn compute_color_swatches_for_view( } // Add annotations to relevant document, not the current one (it may have changed in between) - let doc = match editor.documents.get_mut(&doc_id) { - Some(doc) => doc, - None => return, + let Some(doc) = editor.documents.get_mut(&doc_id) else { + return; }; // If we have neither color swatches nor an LSP, empty the color swatches since they're now oudated