From 3478676f8f7ec6817b1e17d09926fc35a507977a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Thu, 11 Apr 2019 09:54:26 +0200 Subject: [PATCH] Remove redundant closures and imports --- copypasta/src/x11.rs | 2 +- src/cli.rs | 4 ++-- src/grid/row.rs | 2 +- src/term/mod.rs | 3 --- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/copypasta/src/x11.rs b/copypasta/src/x11.rs index 3e0d7913..3bcf8455 100644 --- a/copypasta/src/x11.rs +++ b/copypasta/src/x11.rs @@ -124,7 +124,7 @@ impl Clipboard { S: AsRef, { use std::io::Write; - use std::process::{Command, Stdio}; + use std::process::Stdio; let contents = contents.into(); let mut child = Command::new("xclip").args(args).stdin(Stdio::piped()).spawn()?; diff --git a/src/cli.rs b/src/cli.rs index db108053..2cddbc82 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -182,8 +182,8 @@ impl Options { } if let Some(mut position) = matches.values_of("position") { - let x = position.next().map(|x| x.parse::()); - let y = position.next().map(|y| y.parse::()); + let x = position.next().map(str::parse); + let y = position.next().map(str::parse); if let (Some(Ok(x)), Some(Ok(y))) = (x, y) { options.position = Some(Delta { x, y }); } diff --git a/src/grid/row.rs b/src/grid/row.rs index 0a58de97..88a23871 100644 --- a/src/grid/row.rs +++ b/src/grid/row.rs @@ -133,7 +133,7 @@ impl Row { where T: GridCell, { - self.inner.iter().all(|c| c.is_empty()) + self.inner.iter().all(GridCell::is_empty) } #[inline] diff --git a/src/term/mod.rs b/src/term/mod.rs index 61bc1509..9ab0aad9 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -351,7 +351,6 @@ impl<'a> RenderableCellsIter<'a> { } fn compute_fg_rgb(&self, fg: Color, cell: &Cell) -> Rgb { - use self::cell::Flags; match fg { Color::Spec(rgb) => rgb, Color::Named(ansi) => { @@ -1024,8 +1023,6 @@ impl Term { } } - use std::ops::Range; - trait Append: PushChar { fn append( &mut self,