aboutsummaryrefslogtreecommitdiff
path: root/src/grid.rs
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2016-06-06 17:45:09 -0700
committerJoe Wilm <joe@jwilm.com>2016-06-06 17:45:09 -0700
commit581eb6b69f93f1c1314032b836d4a40896270c28 (patch)
tree7ad69e88b99378d1bb5708b7533dd792a78a3534 /src/grid.rs
parent7834bd177fb30953170889d58c114f98cff2de84 (diff)
downloadalacritty-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.rs8
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) {