diff options
author | Benjamin Sago <ogham@bsago.me> | 2015-12-22 13:35:37 +1100 |
---|---|---|
committer | Benjamin Sago <ogham@bsago.me> | 2015-12-22 15:36:36 +1100 |
commit | 54319a685e61f86fc918f892cefe18b5014524e8 (patch) | |
tree | 29893d83cff778b2e562779b30e003ba7a353c8f | |
parent | d1ea4c0ff546550acb96a73b7bfa5d7c2968450e (diff) |
Use Vec::resize now that it has stabilised
-rw-r--r-- | src/output/details.rs | 9 |
1 files changed, 1 insertions, 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<U> Table<U> 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 }; |