From 60d512a5b3d492282afc9113c4a186772d5126c9 Mon Sep 17 00:00:00 2001 From: Stephan Dilly Date: Sun, 22 Aug 2021 12:53:53 +0200 Subject: [PATCH] fix capacity --- src/components/commitlist.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/commitlist.rs b/src/components/commitlist.rs index b2d0806f..78f227da 100644 --- a/src/components/commitlist.rs +++ b/src/components/commitlist.rs @@ -24,7 +24,7 @@ use tui::{ Frame, }; -const ELEMENTS_PER_LINE: usize = 10; +const ELEMENTS_PER_LINE: usize = 9; /// pub struct CommitList { @@ -235,8 +235,7 @@ impl CommitList { now: DateTime, marked: Option, ) -> Spans<'a> { - let mut txt: Vec = Vec::new(); - txt.reserve( + let mut txt: Vec = Vec::with_capacity( ELEMENTS_PER_LINE + if marked.is_some() { 2 } else { 0 }, );