Skip to content

Commit 56a3d03

Browse files
committed
update rustfmt flags that should work without targets
1 parent d9149fb commit 56a3d03

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)