summaryrefslogtreecommitdiff
path: root/src/grid.rs
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2016-05-21 11:08:50 -0700
committerJoe Wilm <joe@jwilm.com>2016-05-21 11:08:50 -0700
commit855ae756973990be35186d554562a75f692c06e7 (patch)
tree82506bd1a0e75cf3d04cac86e0043fcc0dd6ba8f /src/grid.rs
parentc70acbac0b721ea2f1b1442898c22aee0f360ef2 (diff)
downloadalacritty-855ae756973990be35186d554562a75f692c06e7.tar.gz
alacritty-855ae756973990be35186d554562a75f692c06e7.zip
Add render time meter
Optimization is impossible without measurement!
Diffstat (limited to 'src/grid.rs')
-rw-r--r--src/grid.rs10
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 {