From 54319a685e61f86fc918f892cefe18b5014524e8 Mon Sep 17 00:00:00 2001 From: Benjamin Sago Date: Tue, 22 Dec 2015 13:35:37 +1100 Subject: [PATCH] Use Vec::resize now that it has stabilised --- src/output/details.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/output/details.rs b/src/output/details.rs index 5c3231b..cb9e475 100644 --- a/src/output/details.rs +++ b/src/output/details.rs @@ -113,7 +113,6 @@ use std::error::Error; use std::io; -use std::iter::repeat; use std::ops::Add; use std::path::PathBuf; use std::string::ToString; @@ -711,13 +710,7 @@ impl Table where U: Users { // necessary to maintain information about the previously-printed // lines, as the output will change based on whether the // *previous* entry was the last in its directory. - // TODO: Replace this by Vec::resize() when it becomes stable (1.5.0) - let stack_len = stack.len(); - if row.depth + 1 > stack_len { - stack.extend(repeat(TreePart::Edge).take(row.depth + 1 - stack_len)); - } else { - stack = stack[..(row.depth + 1)].into(); - } + stack.resize(row.depth + 1, TreePart::Edge); stack[row.depth] = if row.last { TreePart::Corner } else { TreePart::Edge };