From cd9512cbce23ad7583b8e73ff2f71b9638a8dfbd Mon Sep 17 00:00:00 2001 From: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com> Date: Mon, 23 Dec 2024 13:45:57 +0000 Subject: [PATCH] refactor: use let else statement --- helix-term/src/commands/lsp.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs index e5b05ea1..fdd17d0e 100644 --- a/helix-term/src/commands/lsp.rs +++ b/helix-term/src/commands/lsp.rs @@ -1255,9 +1255,7 @@ pub fn compute_inlay_hints_for_all_views(editor: &mut Editor, jobs: &mut crate:: } fn lsp_annotations_line_range(view: &View, doc: &Document) -> (usize, usize) { - // Compute ~3 times the current view heigh, that way some scrolling - // will not show half the view with annoations half without while still being faster - // than computing all the hints for the full file + // Compute ~3 times the current view height, that way some scrolling will not show half the view with annotations half without while still being faster than computing all the hints for the full file let doc_text = doc.text(); let len_lines = doc_text.len_lines(); @@ -1412,9 +1410,8 @@ pub fn compute_color_swatches_for_all_views(editor: &mut Editor, jobs: &mut crat } for (view, _) in editor.tree.views() { - let doc = match editor.documents.get(&view.doc) { - Some(doc) => doc, - None => continue, + let Some(doc) = editor.documents.get(&view.doc) else { + continue; }; if let Some(callback) = compute_color_swatches_for_view(view, doc) { jobs.callback(callback);