aboutsummaryrefslogtreecommitdiff
path: root/src/grid.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2017-01-06 15:25:04 -0800
committerManish Goregaokar <manishsmail@gmail.com>2017-01-06 20:17:10 -0800
commit800b65622cd8881f30d4d02e87c1ba4e4c9d27d2 (patch)
treed5532beac05b59e5bb454beb287e314d1b917093 /src/grid.rs
parent085800c330e7f496ecd2298de4762a7cafcbc13a (diff)
downloadalacritty-800b65622cd8881f30d4d02e87c1ba4e4c9d27d2.tar.gz
alacritty-800b65622cd8881f30d4d02e87c1ba4e4c9d27d2.zip
Remove need for step_by feature
Diffstat (limited to 'src/grid.rs')
-rw-r--r--src/grid.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/grid.rs b/src/grid.rs
index 77fe92b9..c5a7f70e 100644
--- a/src/grid.rs
+++ b/src/grid.rs
@@ -27,7 +27,7 @@ use std::ops::{Deref, DerefMut, Range, RangeTo, RangeFrom, RangeFull, Index, Ind
use std::ops::RangeInclusive;
use std::slice::{self, Iter, IterMut};
-use index::{self, Point};
+use index::{self, Point, IndexRange};
/// Convert a type to a linear index range.
pub trait ToRange {
@@ -53,7 +53,7 @@ pub struct Grid<T> {
impl<T: Clone> Grid<T> {
pub fn new(lines: index::Line, cols: index::Column, template: &T) -> Grid<T> {
let mut raw = Vec::with_capacity(*lines);
- for _ in index::Line(0)..lines {
+ for _ in IndexRange(index::Line(0)..lines) {
raw.push(Row::new(cols, template));
}
@@ -84,7 +84,7 @@ impl<T: Clone> Grid<T> {
}
fn grow_lines(&mut self, lines: index::Line, template: &T) {
- for _ in self.num_lines()..lines {
+ for _ in IndexRange(self.num_lines()..lines) {
self.raw.push(Row::new(self.cols, template));
}
@@ -124,7 +124,7 @@ impl<T> Grid<T> {
#[inline]
pub fn scroll_down(&mut self, region: Range<index::Line>, positions: index::Line) {
- for line in region.rev() {
+ for line in IndexRange(region).rev() {
let src = line;
let dst = line - positions;
self.swap_lines(src, dst);
@@ -133,7 +133,7 @@ impl<T> Grid<T> {
#[inline]
pub fn scroll_up(&mut self, region: Range<index::Line>, positions: index::Line) {
- for line in region {
+ for line in IndexRange(region) {
let src = line;
let dst = line + positions;
self.swap_lines(src, dst);