From 855ae756973990be35186d554562a75f692c06e7 Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Sat, 21 May 2016 11:08:50 -0700 Subject: Add render time meter Optimization is impossible without measurement! --- src/grid.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/grid.rs') diff --git a/src/grid.rs b/src/grid.rs index 0418ed53..86a2e45f 100644 --- a/src/grid.rs +++ b/src/grid.rs @@ -9,13 +9,15 @@ pub fn num_cells_axis(cell_width: u32, cell_sep: i32, screen_width: u32) -> u32 #[derive(Clone)] pub struct Cell { - pub character: Option, + pub character: String, } impl Cell { - pub fn new(c: Option) -> Cell { + pub fn new(c: S) -> Cell + where S: Into + { Cell { - character: c, + character: c.into(), } } } @@ -76,7 +78,7 @@ pub struct Row(Vec); impl Row { pub fn new(columns: usize) -> Row { - Row(vec![Cell::new(None); columns]) + Row(vec![Cell::new(""); columns]) } pub fn cols(&self) -> usize { -- cgit