From de79f19b82b22f98c5aa9e4fd7022a631f7abb3f Mon Sep 17 00:00:00 2001 From: EdJoPaTo Date: Sun, 13 Jun 2021 09:29:23 +0200 Subject: [PATCH] refactor: simpify string repeat --- src/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index b6d6519..05b4d1b 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,7 +2,6 @@ use crate::identifier::{TreeIdentifier, TreeIdentifierVec}; use std::collections::HashSet; -use std::iter; use tui::buffer::Buffer; use tui::layout::{Corner, Rect}; use tui::style::Style; @@ -245,9 +244,7 @@ impl<'a> StatefulWidget for Tree<'a> { state.offset = start; let highlight_symbol = self.highlight_symbol.unwrap_or(""); - let blank_symbol = iter::repeat(" ") - .take(highlight_symbol.width()) - .collect::(); + let blank_symbol = " ".repeat(highlight_symbol.width()); let mut current_height = 0; let has_selection = !state.selected.is_empty();