[alacritty_temrinal] Fix redundant imports for unused_imports lint Bug: 326330182 Change-Id: I348e29bbbeed492f1bed2dcc43f64dfcda3edce3
diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs index 4452409..2f11b64 100644 --- a/alacritty_terminal/src/ansi.rs +++ b/alacritty_terminal/src/ansi.rs
@@ -19,8 +19,6 @@ use log::{debug, trace}; use serde::{Deserialize, Serialize}; -use vte; - use crate::index::{Column, Line}; use crate::term::color::Rgb;
diff --git a/alacritty_terminal/src/grid/storage.rs b/alacritty_terminal/src/grid/storage.rs index 145e302..9b31e69 100644 --- a/alacritty_terminal/src/grid/storage.rs +++ b/alacritty_terminal/src/grid/storage.rs
@@ -1,4 +1,4 @@ -use std::cmp::{max, PartialEq}; +use std::cmp::max; use std::ops::{Index, IndexMut}; use std::vec::Drain;
diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index 8789edd..55b437d 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs
@@ -239,11 +239,11 @@ (Some(start), None) => { let end = Point::new(num_lines.0 - 1, num_cols - 1); (start, end) - } + }, (None, Some(end)) => { let start = Point::new(0, Column(0)); (start, end) - } + }, (None, None) => return None, }; @@ -356,7 +356,7 @@ && config.colors.primary.bright_foreground.is_none() => { colors[NamedColor::DimForeground] - } + }, // Draw bold text in bright colors *and* contains bold flag. (true, Flags::BOLD) => colors[ansi.to_bright()], // Cell is marked as dim and not bold @@ -364,7 +364,7 @@ // None of the above, keep original color. _ => colors[ansi], } - } + }, Color::Indexed(idx) => { let idx = match ( config.draw_bold_text_with_bright_colors(), @@ -378,7 +378,7 @@ }; colors[idx] - } + }, } } @@ -638,7 +638,7 @@ self.start_time = None; } false - } + }, None => true, } } @@ -683,12 +683,12 @@ let inverse_intensity = match self.animation { VisualBellAnimation::Ease | VisualBellAnimation::EaseOut => { cubic_bezier(0.25, 0.1, 0.25, 1.0, time) - } + }, VisualBellAnimation::EaseOutSine => cubic_bezier(0.39, 0.575, 0.565, 1.0, time), VisualBellAnimation::EaseOutQuad => cubic_bezier(0.25, 0.46, 0.45, 0.94, time), VisualBellAnimation::EaseOutCubic => { cubic_bezier(0.215, 0.61, 0.355, 1.0, time) - } + }, VisualBellAnimation::EaseOutQuart => cubic_bezier(0.165, 0.84, 0.44, 1.0, time), VisualBellAnimation::EaseOutQuint => cubic_bezier(0.23, 1.0, 0.32, 1.0, time), VisualBellAnimation::EaseOutExpo => cubic_bezier(0.19, 1.0, 0.22, 1.0, time), @@ -699,7 +699,7 @@ // Since we want the `intensity` of the VisualBell to decay over // `time`, we subtract the `inverse_intensity` from 1.0. 1.0 - inverse_intensity - } + }, } } @@ -1456,12 +1456,12 @@ match arg { 5 => { let _ = writer.write_all(b"\x1b[0n"); - } + }, 6 => { let pos = self.cursor.point; let response = format!("\x1b[{};{}R", pos.line + 1, pos.col + 1); let _ = writer.write_all(response.as_bytes()); - } + }, _ => debug!("unknown device status query: {}", arg), }; } @@ -1714,19 +1714,19 @@ for cell in &mut row[col..] { cell.reset(&self.cursor.template); } - } + }, ansi::LineClearMode::Left => { let row = &mut self.grid[self.cursor.point.line]; for cell in &mut row[..=col] { cell.reset(&self.cursor.template); } - } + }, ansi::LineClearMode::All => { let row = &mut self.grid[self.cursor.point.line]; for cell in &mut row[..] { cell.reset(&self.cursor.template); } - } + }, } } @@ -1811,7 +1811,7 @@ for cell in &mut self.grid[self.cursor.point.line][..end] { cell.reset(&template); } - } + }, ansi::ClearMode::Below => { for cell in &mut self.grid[self.cursor.point.line][self.cursor.point.col..] { cell.reset(&template); @@ -1821,7 +1821,7 @@ .region_mut((self.cursor.point.line + 1)..) .each(|cell| cell.reset(&template)); } - } + }, ansi::ClearMode::All => { if self.mode.contains(TermMode::ALT_SCREEN) { self.grid.region_mut(..).each(|c| c.reset(&template)); @@ -1829,7 +1829,7 @@ let template = Cell { bg: template.bg, ..Cell::default() }; self.grid.clear_viewport(&template); } - } + }, ansi::ClearMode::Saved => self.grid.clear_history(), } } @@ -1841,10 +1841,10 @@ ansi::TabulationClearMode::Current => { let column = self.cursor.point.col; self.tabs[column] = false; - } + }, ansi::TabulationClearMode::All => { self.tabs.clear_all(); - } + }, } } @@ -1892,7 +1892,7 @@ self.cursor.template.fg = Color::Named(NamedColor::Foreground); self.cursor.template.bg = Color::Named(NamedColor::Background); self.cursor.template.flags = Flags::empty(); - } + }, Attr::Reverse => self.cursor.template.flags.insert(Flags::INVERSE), Attr::CancelReverse => self.cursor.template.flags.remove(Flags::INVERSE), Attr::Bold => self.cursor.template.flags.insert(Flags::BOLD), @@ -1909,7 +1909,7 @@ Attr::CancelStrike => self.cursor.template.flags.remove(Flags::STRIKEOUT), _ => { debug!("Term got unhandled attr: {:?}", attr); - } + }, } } @@ -1924,7 +1924,7 @@ self.swap_alt(); self.save_cursor_position(); } - } + }, ansi::Mode::ShowCursor => self.mode.insert(TermMode::SHOW_CURSOR), ansi::Mode::CursorKeys => self.mode.insert(TermMode::APP_CURSOR), // Mouse protocols are mutually exlusive @@ -1932,28 +1932,28 @@ self.mode.remove(TermMode::MOUSE_MODE); self.mode.insert(TermMode::MOUSE_REPORT_CLICK); self.event_proxy.send_event(Event::MouseCursorDirty); - } + }, ansi::Mode::ReportCellMouseMotion => { self.mode.remove(TermMode::MOUSE_MODE); self.mode.insert(TermMode::MOUSE_DRAG); self.event_proxy.send_event(Event::MouseCursorDirty); - } + }, ansi::Mode::ReportAllMouseMotion => { self.mode.remove(TermMode::MOUSE_MODE); self.mode.insert(TermMode::MOUSE_MOTION); self.event_proxy.send_event(Event::MouseCursorDirty); - } + }, ansi::Mode::ReportFocusInOut => self.mode.insert(TermMode::FOCUS_IN_OUT), ansi::Mode::BracketedPaste => self.mode.insert(TermMode::BRACKETED_PASTE), // Mouse encodings are mutually exlusive ansi::Mode::SgrMouse => { self.mode.remove(TermMode::UTF8_MOUSE); self.mode.insert(TermMode::SGR_MOUSE); - } + }, ansi::Mode::Utf8Mouse => { self.mode.remove(TermMode::SGR_MOUSE); self.mode.insert(TermMode::UTF8_MOUSE); - } + }, ansi::Mode::AlternateScroll => self.mode.insert(TermMode::ALTERNATE_SCROLL), ansi::Mode::LineWrap => self.mode.insert(TermMode::LINE_WRAP), ansi::Mode::LineFeedNewLine => self.mode.insert(TermMode::LINE_FEED_NEW_LINE), @@ -1962,7 +1962,7 @@ ansi::Mode::Insert => self.mode.insert(TermMode::INSERT), // heh ansi::Mode::BlinkingCursor => { trace!("... unimplemented mode"); - } + }, } } @@ -1977,21 +1977,21 @@ self.swap_alt(); self.restore_cursor_position(); } - } + }, ansi::Mode::ShowCursor => self.mode.remove(TermMode::SHOW_CURSOR), ansi::Mode::CursorKeys => self.mode.remove(TermMode::APP_CURSOR), ansi::Mode::ReportMouseClicks => { self.mode.remove(TermMode::MOUSE_REPORT_CLICK); self.event_proxy.send_event(Event::MouseCursorDirty); - } + }, ansi::Mode::ReportCellMouseMotion => { self.mode.remove(TermMode::MOUSE_DRAG); self.event_proxy.send_event(Event::MouseCursorDirty); - } + }, ansi::Mode::ReportAllMouseMotion => { self.mode.remove(TermMode::MOUSE_MOTION); self.event_proxy.send_event(Event::MouseCursorDirty); - } + }, ansi::Mode::ReportFocusInOut => self.mode.remove(TermMode::FOCUS_IN_OUT), ansi::Mode::BracketedPaste => self.mode.remove(TermMode::BRACKETED_PASTE), ansi::Mode::SgrMouse => self.mode.remove(TermMode::SGR_MOUSE), @@ -2004,7 +2004,7 @@ ansi::Mode::Insert => self.mode.remove(TermMode::INSERT), ansi::Mode::BlinkingCursor => { trace!("... unimplemented mode"); - } + }, } } @@ -2123,8 +2123,6 @@ mod tests { use std::mem; - use serde_json; - use crate::ansi::{self, CharsetIndex, Handler, StandardCharset}; use crate::clipboard::Clipboard; use crate::config::MockConfig;