on master help sign in
open_below: drop redundant collect/into_iter.
commitdef949e509bb79c40a9e64fc34b91cc1830c0e41 authorBlaž Hrastnik <blaz@mxxn.io> dateMon 22 Feb 2021, 17:01 (6 years ago) parent6cfb1ac
1 file changed+5−8
helix-term/src/commands.rs+5−8
helix-term/src/commands.rs+5−8
@@ -605,15 +605,12 @@ pub fn open_below(cx: &mut Context) {
605605
606606 let lines = selection_lines(&doc.state);
607607
608− let positions: Vec<_> = lines
609− .into_iter()
610− .map(|index| {
611− // adjust all positions to the end of the line/start of the next one.
612− doc.text().line_to_char(index + 1)
613− })
614− .collect();
608+ let positions = lines.into_iter().map(|index| {
609+ // adjust all positions to the end of the line/start of the next one.
610+ doc.text().line_to_char(index + 1)
611+ });
615612
616− let changes = positions.iter().copied().map(|index| {
613+ let changes = positions.map(|index| {
617614 // TODO: share logic with insert_newline for indentation
618615 let indent_level = helix_core::indent::suggested_indent_for_pos(
619616 doc.syntax.as_ref(),