#![cfg_attr(feature = "deny-warnings", deny(warnings))]
+// warn on lints, that are included in `rust-lang/rust`s bootstrap
+#![warn(rust_2018_idioms, unused_lifetimes)]
use rustc_tools_util::VersionInfo;
use std::env;
}
}
- fn path(&self) -> PathBuf {
+ fn path() -> PathBuf {
let mut path = env::current_exe()
.expect("current executable path invalid")
.with_file_name("clippy-driver");
.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)
{
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()
#[cfg(test)]
mod tests {
- use super::*;
+ use super::ClippyCmd;
#[test]
#[should_panic]
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]