From 2100f5a2c07cd58e05b11d124d56e15fe23685d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Mon, 17 May 2021 23:01:45 +0900 Subject: [PATCH] Address clippy lint. --- helix-view/src/editor.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index cf4dce28..e9f8b5a1 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -85,7 +85,10 @@ impl Editor { let (view, doc) = self.current(); // initialize selection for view - let selection = doc.selections.entry(view.id).or_insert(Selection::point(0)); + let selection = doc + .selections + .entry(view.id) + .or_insert_with(|| Selection::point(0)); // TODO: reuse align_view let pos = selection.cursor(); let line = doc.text().char_to_line(pos);