diff options
author | Blaž Hrastnik | 2021-05-17 14:01:45 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-05-17 14:01:45 +0000 |
commit | 2100f5a2c07cd58e05b11d124d56e15fe23685d0 (patch) | |
tree | 03d52ffefbef05bad75fe026106e3d545947a1fe | |
parent | 8f6f3290573649e3ca8cadda3541fdda45587f23 (diff) |
Address clippy lint.
-rw-r--r-- | helix-view/src/editor.rs | 5 |
1 files changed, 4 insertions, 1 deletions
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); |