update rustfmt flags that should work without targets

This commit is contained in:
king6cong 2018-06-05 15:34:53 +08:00
parent d9149fb52e
commit 56a3d039ce

View File

@ -147,7 +147,11 @@ fn format_crate(
strategy: &CargoFmtStrategy,
) -> Result<ExitStatus, io::Error> {
let rustfmt_args = get_fmt_args();
let targets = if rustfmt_args.iter().any(|s| s == "--dump-default-config") {
let targets = if rustfmt_args
.iter()
.any(|s| ["--print-config", "-h", "--help", "-V", "--verison"]
.contains(&s.as_str()))
{
HashSet::new()
} else {
get_targets(strategy)?