diff options
author | Joe Wilm <jwilm@users.noreply.github.com> | 2018-12-10 09:53:56 -0800 |
---|---|---|
committer | Christian Duerr <chrisduerr@users.noreply.github.com> | 2018-12-10 17:53:56 +0000 |
commit | 217ad9ec285b4923de1790b0976c8c793039c994 (patch) | |
tree | 440e0d6d35f119246d2b113fd01b431f4f9c2c38 /src/grid/storage.rs | |
parent | 7ab0b448479c9705fa14003bda97040630710b7a (diff) | |
download | r-alacritty-217ad9ec285b4923de1790b0976c8c793039c994.tar.gz r-alacritty-217ad9ec285b4923de1790b0976c8c793039c994.tar.bz2 r-alacritty-217ad9ec285b4923de1790b0976c8c793039c994.zip |
Upgrade to Rust 2018
This resolves a lot of NLL issues, however full NLL will be necessary to
handle a couple of remaining issues.
Diffstat (limited to 'src/grid/storage.rs')
-rw-r--r-- | src/grid/storage.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/grid/storage.rs b/src/grid/storage.rs index 471afdae..19c1636d 100644 --- a/src/grid/storage.rs +++ b/src/grid/storage.rs @@ -14,7 +14,9 @@ use std::ops::{Index, IndexMut}; use std::slice; -use index::Line; +use static_assertions::assert_eq_size; + +use crate::index::Line; use super::Row; /// Maximum number of invisible lines before buffer is resized @@ -277,8 +279,7 @@ impl<T> Index<usize> for Storage<T> { type Output = Row<T>; #[inline] fn index(&self, index: usize) -> &Self::Output { - let index = self.compute_index(index); // borrowck - &self.inner[index] + &self.inner[self.compute_index(index)] } } @@ -308,7 +309,7 @@ impl<T> IndexMut<Line> for Storage<T> { } #[cfg(test)] -use index::Column; +use crate::index::Column; /// Grow the buffer one line at the end of the buffer /// |