From 7834bd177fb30953170889d58c114f98cff2de84 Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Mon, 6 Jun 2016 17:44:06 -0700 Subject: [PATCH] Fix bug where there were extra grid rows Apparently VecDeque::with_capacity is more of a suggestion. --- src/grid.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/grid.rs b/src/grid.rs index 3b3acf9b..e904a5b0 100644 --- a/src/grid.rs +++ b/src/grid.rs @@ -60,7 +60,7 @@ pub struct Grid { impl Grid { pub fn new(rows: usize, cols: usize) -> Grid { let mut raw = VecDeque::with_capacity(rows); - for _ in 0..raw.capacity() { + for _ in 0..rows { raw.push_back(Row::new(cols)); }