From 0397e46ea549b640173f059ae8cfae72c4746f28 Mon Sep 17 00:00:00 2001 From: Jane Lusby Date: Wed, 15 Apr 2020 13:04:04 -0700 Subject: [PATCH] fmt --- src/main.rs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/main.rs b/src/main.rs index d82b0a3cf6b..61875b11095 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,9 +2,9 @@ use rustc_tools_util::VersionInfo; use std::env; +use std::ffi::OsString; use std::path::PathBuf; use std::process::{self, Command}; -use std::ffi::OsString; const CARGO_CLIPPY_HELP: &str = r#"Checks a package to catch common mistakes and improve your Rust code. @@ -60,11 +60,10 @@ struct ClippyCmd { unstable_options: bool, cargo_subcommand: &'static str, args: Vec, - clippy_args: String + clippy_args: String, } -impl ClippyCmd -{ +impl ClippyCmd { fn new(mut old_args: I) -> Self where I: Iterator, @@ -98,10 +97,7 @@ impl ClippyCmd args.insert(0, "+nightly".to_string()); } - let clippy_args: String = - old_args - .map(|arg| format!("{}__CLIPPY_HACKERY__", arg)) - .collect(); + let clippy_args: String = old_args.map(|arg| format!("{}__CLIPPY_HACKERY__", arg)).collect(); ClippyCmd { unstable_options, @@ -160,7 +156,6 @@ impl ClippyCmd } } - fn process(old_args: I) -> Result<(), i32> where I: Iterator, @@ -195,7 +190,9 @@ mod tests { #[test] fn fix_unstable() { - let args = "cargo clippy --fix -Zunstable-options".split_whitespace().map(ToString::to_string); + let args = "cargo clippy --fix -Zunstable-options" + .split_whitespace() + .map(ToString::to_string); let cmd = ClippyCmd::new(args); assert_eq!("fix", cmd.cargo_subcommand); assert_eq!("RUSTC_WORKSPACE_WRAPPER", cmd.path_env()); @@ -212,7 +209,9 @@ mod tests { #[test] fn check_unstable() { - let args = "cargo clippy -Zunstable-options".split_whitespace().map(ToString::to_string); + let args = "cargo clippy -Zunstable-options" + .split_whitespace() + .map(ToString::to_string); let cmd = ClippyCmd::new(args); assert_eq!("check", cmd.cargo_subcommand); assert_eq!("RUSTC_WORKSPACE_WRAPPER", cmd.path_env());