From 7a97b7d40cfaf49119c8d11b484066d85aa835a2 Mon Sep 17 00:00:00 2001 From: Florian Gilcher Date: Wed, 4 Nov 2015 11:07:31 +0100 Subject: Reserve Vector elements instead of resizing --- src/output/details.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/output') diff --git a/src/output/details.rs b/src/output/details.rs index 4eb0580..49c3fd1 100644 --- a/src/output/details.rs +++ b/src/output/details.rs @@ -683,7 +683,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. - stack.resize(row.depth + 1, TreePart::Edge); + stack.reserve(row.depth + 1); stack[row.depth] = if row.last { TreePart::Corner } else { TreePart::Edge }; for i in 1 .. row.depth + 1 { -- cgit v1.2.3