Skip to content

Commit

Permalink
cargo-fmt: skip only the executable name
Browse files Browse the repository at this point in the history
  • Loading branch information
scampi committed Feb 1, 2019
1 parent 923da60 commit 2a76d95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cargo-fmt/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn execute() -> i32 {

// If there is any invalid argument passed to `cargo fmt`, return without formatting.
let mut is_package_arg = false;
for arg in env::args().skip(2).take_while(|a| a != "--") {
for arg in env::args().skip(1).take_while(|a| a != "--") {
if arg.starts_with('-') {
is_package_arg = arg.starts_with("--package") | arg.starts_with("-p");
} else if !is_package_arg {
Expand Down

0 comments on commit 2a76d95

Please sign in to comment.