1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-11 13:51:01 -05:00

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.
This commit is contained in:
Joe Wilm 2016-06-06 17:45:09 -07:00
parent 7834bd177f
commit 581eb6b69f
No known key found for this signature in database
GPG key ID: 39B57C6972F518DA

View file

@ -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) {