diff options
author | Matthias Krüger <matthias.krueger@famsik.de> | 2019-04-11 09:54:26 +0200 |
---|---|---|
committer | Christian Duerr <chrisduerr@users.noreply.github.com> | 2019-04-11 07:54:26 +0000 |
commit | 3478676f8f7ec6817b1e17d09926fc35a507977a (patch) | |
tree | c1b6d403446a312b635a3f1b75e884c3bc646a60 | |
parent | d406627acb68ff861803c09089462027eb69b5e5 (diff) | |
download | alacritty-3478676f8f7ec6817b1e17d09926fc35a507977a.tar.gz alacritty-3478676f8f7ec6817b1e17d09926fc35a507977a.zip |
Remove redundant closures and imports
-rw-r--r-- | copypasta/src/x11.rs | 2 | ||||
-rw-r--r-- | src/cli.rs | 4 | ||||
-rw-r--r-- | src/grid/row.rs | 2 | ||||
-rw-r--r-- | 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<OsStr>, { 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()?; @@ -182,8 +182,8 @@ impl Options { } if let Some(mut position) = matches.values_of("position") { - let x = position.next().map(|x| x.parse::<i32>()); - let y = position.next().map(|y| y.parse::<i32>()); + 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<T> Row<T> { 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, |