From 9f6b21f0dbda19f6d03320c6436627b80485cbc8 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 18 Feb 2019 23:20:59 -0800 Subject: [PATCH] update term to 2018 edition --- term/Cargo.toml | 1 + term/src/lib.rs | 15 +++++---------- term/src/terminalstate.rs | 10 +++++----- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/term/Cargo.toml b/term/Cargo.toml index 526a72879..59e5aeb9c 100644 --- a/term/Cargo.toml +++ b/term/Cargo.toml @@ -2,6 +2,7 @@ authors = ["Wez Furlong "] name = "term" version = "0.1.0" +edition = "2018" [dependencies] bitflags = "~1.0" diff --git a/term/src/lib.rs b/term/src/lib.rs index fa611de26..e957c5f54 100644 --- a/term/src/lib.rs +++ b/term/src/lib.rs @@ -3,11 +3,6 @@ extern crate bitflags; #[macro_use] extern crate failure; -extern crate image; -extern crate ordered_float; -extern crate termwiz; -extern crate unicode_segmentation; -extern crate unicode_width; use failure::Error; use std::ops::{Deref, DerefMut, Range}; @@ -18,25 +13,25 @@ use std::str; mod debug; pub mod input; -pub use input::*; +pub use crate::input::*; pub use termwiz::cell::{self, *}; pub use termwiz::surface::line::*; pub mod screen; -pub use screen::*; +pub use crate::screen::*; pub mod selection; -use selection::{SelectionCoordinate, SelectionRange}; +use crate::selection::{SelectionCoordinate, SelectionRange}; use termwiz::hyperlink::Hyperlink; pub mod terminal; -pub use terminal::*; +pub use crate::terminal::*; pub mod terminalstate; -pub use terminalstate::*; +pub use crate::terminalstate::*; /// Represents the index into screen.lines. Index 0 is the top of /// the scrollback (if any). The index of the top of the visible screen diff --git a/term/src/terminalstate.rs b/term/src/terminalstate.rs index 9380a5ceb..9e1306b75 100644 --- a/term/src/terminalstate.rs +++ b/term/src/terminalstate.rs @@ -357,7 +357,7 @@ impl TerminalState { /// Invalidate rows that have hyperlinks fn invalidate_hyperlinks(&mut self) { let screen = self.screen_mut(); - for mut line in &mut screen.lines { + for line in &mut screen.lines { if line.has_hyperlink() { line.set_dirty(); } @@ -675,7 +675,7 @@ impl TerminalState { const ALT: KeyModifiers = KeyModifiers::ALT; const NO: KeyModifiers = KeyModifiers::NONE; const APPCURSOR: bool = true; - use KeyCode::*; + use crate::KeyCode::*; let ctrl = mods & CTRL; let shift = mods & SHIFT; @@ -934,7 +934,7 @@ impl TerminalState { let selection = self.selection_range.map(|r| r.normalize()); - for (i, mut line) in screen.lines.iter().skip(len - height).enumerate() { + for (i, line) in screen.lines.iter().skip(len - height).enumerate() { if i >= height { // When scrolling back, make sure we don't emit lines that // are below the bottom of the viewport @@ -965,7 +965,7 @@ impl TerminalState { /// Clear the dirty flag for all dirty lines pub fn clean_dirty_lines(&mut self) { let screen = self.screen_mut(); - for mut line in &mut screen.lines { + for line in &mut screen.lines { line.clear_dirty(); } } @@ -973,7 +973,7 @@ impl TerminalState { /// When dealing with selection, mark a range of lines as dirty pub fn make_all_lines_dirty(&mut self) { let screen = self.screen_mut(); - for mut line in &mut screen.lines { + for line in &mut screen.lines { line.set_dirty(); } }