Skip to content

Commit 9e208cb

Browse files
authored
Merge pull request #2768 from king6cong/master
update rustfmt flags that should work without targets
2 parents d9149fb + 56a3d03 commit 9e208cb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/cargo-fmt/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,11 @@ fn format_crate(
147147
strategy: &CargoFmtStrategy,
148148
) -> Result<ExitStatus, io::Error> {
149149
let rustfmt_args = get_fmt_args();
150-
let targets = if rustfmt_args.iter().any(|s| s == "--dump-default-config") {
150+
let targets = if rustfmt_args
151+
.iter()
152+
.any(|s| ["--print-config", "-h", "--help", "-V", "--verison"]
153+
.contains(&s.as_str()))
154+
{
151155
HashSet::new()
152156
} else {
153157
get_targets(strategy)?

0 commit comments

Comments
 (0)