aboutsummaryrefslogtreecommitdiff
path: root/src/grid.rs
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2017-04-03 20:21:55 -0700
committerJoe Wilm <jwilm@users.noreply.github.com>2017-04-03 20:44:23 -0700
commit79576b6c0b45868caeef36c5255720a7de6e57de (patch)
tree4edf7dc740601c75bf83dabeb0247c5145753d45 /src/grid.rs
parenta66d19f6337e1dfc756680b8fcb960f84453e783 (diff)
downloadalacritty-79576b6c0b45868caeef36c5255720a7de6e57de.tar.gz
alacritty-79576b6c0b45868caeef36c5255720a7de6e57de.zip
Add better printing for ref test failure
The previous format was extremely difficult for a human to parse.
Diffstat (limited to 'src/grid.rs')
-rw-r--r--src/grid.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/grid.rs b/src/grid.rs
index 1c5b94c4..af3a8ae4 100644
--- a/src/grid.rs
+++ b/src/grid.rs
@@ -146,6 +146,10 @@ impl<T> Grid<T> {
self.cols
}
+ pub fn iter_rows(&self) -> slice::Iter<Row<T>> {
+ self.raw.iter()
+ }
+
#[inline]
pub fn scroll_down(&mut self, region: Range<index::Line>, positions: index::Line) {
for line in IndexRange(region).rev() {
@@ -334,6 +338,16 @@ impl<T> Row<T> {
}
}
+impl<'a, T> IntoIterator for &'a Grid<T> {
+ type Item = &'a Row<T>;
+ type IntoIter = slice::Iter<'a, Row<T>>;
+
+ #[inline]
+ fn into_iter(self) -> slice::Iter<'a, Row<T>> {
+ self.raw.iter()
+ }
+}
+
impl<'a, T> IntoIterator for &'a Row<T> {
type Item = &'a T;
type IntoIter = slice::Iter<'a, T>;