aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-02-22 08:01:57 +0000
committerBlaž Hrastnik2021-02-22 08:02:32 +0000
commitdef949e509bb79c40a9e64fc34b91cc1830c0e41 (patch)
tree7298818ed34f9a4b5e4e0c44fe22bd4557ac3396 /helix-term
parent6cfb1acb9d1456e854a2c44ee8fc057f45b29ea9 (diff)
open_below: drop redundant collect/into_iter.
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/commands.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index c37c0710..c2865007 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -605,15 +605,12 @@ pub fn open_below(cx: &mut Context) {
let lines = selection_lines(&doc.state);
- let positions: Vec<_> = lines
- .into_iter()
- .map(|index| {
- // adjust all positions to the end of the line/start of the next one.
- doc.text().line_to_char(index + 1)
- })
- .collect();
+ let positions = lines.into_iter().map(|index| {
+ // adjust all positions to the end of the line/start of the next one.
+ doc.text().line_to_char(index + 1)
+ });
- let changes = positions.iter().copied().map(|index| {
+ let changes = positions.map(|index| {
// TODO: share logic with insert_newline for indentation
let indent_level = helix_core::indent::suggested_indent_for_pos(
doc.syntax.as_ref(),