Remove redundant closures and imports

This commit is contained in:
Matthias Krüger 2019-04-11 09:54:26 +02:00 committed by Christian Duerr
parent d406627acb
commit 3478676f8f
4 changed files with 4 additions and 7 deletions

View File

@ -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()?;

View File

@ -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 });
}

View File

@ -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]

View File

@ -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,