From 12ffcb0d390efbe1cd7a03447cc0eed4ab189298 Mon Sep 17 00:00:00 2001 From: SoraTenshi Date: Tue, 3 Oct 2023 14:41:00 +0200 Subject: [PATCH] Fix clippy issues --- helix-term/src/ui/context.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/helix-term/src/ui/context.rs b/helix-term/src/ui/context.rs index 734a4ce88..e3a86026f 100644 --- a/helix-term/src/ui/context.rs +++ b/helix-term/src/ui/context.rs @@ -148,9 +148,9 @@ pub fn calculate_sticky_nodes( } while start_node - .unwrap_or(tree.root_node()) + .unwrap_or_else(|| tree.root_node()) .parent() - .unwrap_or(tree.root_node()) + .unwrap_or_else(|| tree.root_node()) .byte_range() != tree.root_node().byte_range() { @@ -176,7 +176,7 @@ pub fn calculate_sticky_nodes( let query = &context_nodes.query; let query_nodes = cursor.matches( query, - start_node.unwrap_or(tree.root_node()), + start_node.unwrap_or_else(|| tree.root_node()), RopeProvider(text), ); @@ -265,7 +265,7 @@ pub fn calculate_sticky_nodes( }); } - return Some(res); + Some(res) } /// Render the sticky context @@ -277,8 +277,8 @@ pub fn render_sticky_context( theme: &Theme, ) { let Some(context) = context else { - return; - }; + return; + }; let text = doc.text().slice(..); let viewport = view.inner_area(doc);