diff options
author | Joe Wilm <joe@jwilm.com> | 2016-06-06 17:45:09 -0700 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-06-06 17:45:09 -0700 |
commit | 581eb6b69f93f1c1314032b836d4a40896270c28 (patch) | |
tree | 7ad69e88b99378d1bb5708b7533dd792a78a3534 /src/grid.rs | |
parent | 7834bd177fb30953170889d58c114f98cff2de84 (diff) | |
download | alacritty-581eb6b69f93f1c1314032b836d4a40896270c28.tar.gz alacritty-581eb6b69f93f1c1314032b836d4a40896270c28.zip |
Tweak some Grid methods
Adds some #[inline] tags, and delegates to internals for num_rows and
num_cols. In case these become different than the expected values, this
should help to fail sooner.
Diffstat (limited to 'src/grid.rs')
-rw-r--r-- | src/grid.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/grid.rs b/src/grid.rs index e904a5b0..e094867d 100644 --- a/src/grid.rs +++ b/src/grid.rs @@ -71,20 +71,24 @@ impl Grid { } } + #[inline] pub fn rows(&self) -> vec_deque::Iter<Row> { self.raw.iter() } + #[inline] pub fn rows_mut(&mut self) -> vec_deque::IterMut<Row> { self.raw.iter_mut() } + #[inline] pub fn num_rows(&self) -> usize { - self.rows + self.raw.len() } + #[inline] pub fn num_cols(&self) -> usize { - self.cols + self.raw[0].len() } pub fn feed(&mut self) { |