From 217ad9ec285b4923de1790b0976c8c793039c994 Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Mon, 10 Dec 2018 09:53:56 -0800 Subject: Upgrade to Rust 2018 This resolves a lot of NLL issues, however full NLL will be necessary to handle a couple of remaining issues. --- src/grid/storage.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/grid/storage.rs') 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 Index for Storage { type Output = Row; #[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 IndexMut for Storage { } #[cfg(test)] -use index::Column; +use crate::index::Column; /// Grow the buffer one line at the end of the buffer /// -- cgit