diff options
Diffstat (limited to 'src/grid.rs')
-rw-r--r-- | src/grid.rs | 10 |
1 files changed, 6 insertions, 4 deletions
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<String>, + pub character: String, } impl Cell { - pub fn new(c: Option<String>) -> Cell { + pub fn new<S>(c: S) -> Cell + where S: Into<String> + { Cell { - character: c, + character: c.into(), } } } @@ -76,7 +78,7 @@ pub struct Row(Vec<Cell>); impl Row { pub fn new(columns: usize) -> Row { - Row(vec![Cell::new(None); columns]) + Row(vec![Cell::new(""); columns]) } pub fn cols(&self) -> usize { |