diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-11-06 13:11:22 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-11-06 13:11:22 -0500 |
commit | d778408be8b12fcc16a8fcaccde49bef927f22e0 (patch) | |
tree | 0cfbe005a54ca3146d335c98b91203a1e114c392 /src/grid.rs | |
parent | 07ecf81b095cc1f23428f05079d65aa5d1677ca4 (diff) | |
download | vt100-rust-d778408be8b12fcc16a8fcaccde49bef927f22e0.tar.gz vt100-rust-d778408be8b12fcc16a8fcaccde49bef927f22e0.zip |
make row.contents_diff not require the row index
Diffstat (limited to 'src/grid.rs')
-rw-r--r-- | src/grid.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/grid.rs b/src/grid.rs index 0e0ff9d..075e604 100644 --- a/src/grid.rs +++ b/src/grid.rs @@ -176,12 +176,10 @@ impl Grid { let mut final_col = prev.pos.col; for (idx, (row, prev_row)) in self.rows().zip(prev.rows()).enumerate() { - let (mut new_contents, new_attrs, new_col) = row.contents_diff( - idx.try_into().unwrap(), - prev_row, - prev_attrs, - ); + let (mut new_contents, new_attrs, new_col) = + row.contents_diff(prev_row, prev_attrs); if !new_contents.is_empty() { + contents.extend(format!("\x1b[{};1H", idx + 1).as_bytes()); final_row = idx.try_into().unwrap(); final_col = new_col; } |