diff options
| author | Jane Lusby <jlusby42@gmail.com> | 2020-04-15 14:25:42 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-15 14:25:42 -0700 |
| commit | 5cfb9ec1d7d66ecebd86761cef091766c65c09d9 (patch) | |
| tree | 1ec72c9a807a68efc5c49a28f71d15def2382dcb | |
| parent | 664ad33faf5f0a32eeec6cbec3335e9dd47e907a (diff) | |
| download | rust-5cfb9ec1d7d66ecebd86761cef091766c65c09d9.tar.gz rust-5cfb9ec1d7d66ecebd86761cef091766c65c09d9.zip | |
Apply suggestions from code review
Co-Authored-By: Philipp Krones <hello@philkrones.com>
| -rw-r--r-- | src/main.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs index e299cf4febf..bc43a34ed5d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -115,7 +115,7 @@ impl ClippyCmd { } } - fn path(&self) -> PathBuf { + fn path() -> PathBuf { let mut path = env::current_exe() .expect("current executable path invalid") .with_file_name("clippy-driver"); @@ -143,10 +143,10 @@ impl ClippyCmd { .map(|p| ("CARGO_TARGET_DIR", p)) } - fn to_std_cmd(self) -> Command { + fn into_std_cmd(self) -> Command { let mut cmd = Command::new("cargo"); - cmd.env(self.path_env(), self.path()) + cmd.env(self.path_env(), Self::path()) .envs(ClippyCmd::target_dir()) .env("CLIPPY_ARGS", self.clippy_args) .arg(self.cargo_subcommand) @@ -162,7 +162,7 @@ where { let cmd = ClippyCmd::new(old_args); - let mut cmd = cmd.to_std_cmd(); + let mut cmd = cmd.into_std_cmd(); let exit_status = cmd .spawn() @@ -179,7 +179,7 @@ where #[cfg(test)] mod tests { - use super::*; + use super::ClippyCmd; #[test] #[should_panic] @@ -196,7 +196,7 @@ mod tests { let cmd = ClippyCmd::new(args); assert_eq!("fix", cmd.cargo_subcommand); assert_eq!("RUSTC_WORKSPACE_WRAPPER", cmd.path_env()); - assert!(cmd.args.iter().find(|arg| arg.ends_with("unstable-options")).is_some()); + assert!(cmd.args.iter().any(|arg| arg.ends_with("unstable-options"))); } #[test] |
