Merge pull request #2768 from king6cong/master

update rustfmt flags that should work without targets
This commit is contained in:
Nick Cameron 2018-06-05 20:09:29 +12:00 committed by GitHub
commit 9e208cb13a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)?