Skip to content

Commit 56d2dd9

Browse files
committed
add warning that "cargo-clippy arg1 arg2" will no longer ignore arg1 after edition 2024
1 parent b9b12d4 commit 56d2dd9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/main.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,15 @@ pub fn main() {
4747
// if we run "cargo clippy" (as cargo subcommand), we have to strip "cargo clippy" (first 2 args)
4848
// but if we are run via "..../target/debug/cargo-clippy", only ommit the first arg, the second one
4949
// might be a normal cmdline arg already (which we don't want to ommit)
50-
let args = if let Some(first_arg) = env::args().next() && (first_arg.ends_with("cargo-clippy") || first_arg.ends_with("cargo-clippy.exe")) {
51-
env::args().skip(1)
50+
let args = if let Some(first_arg) = env::args().next()
51+
&& (first_arg.ends_with("cargo-clippy") || first_arg.ends_with("cargo-clippy.exe"))
52+
{
53+
// turn this of during the migration
54+
// env::args().skip(1)
55+
eprintln!(
56+
"WARNING: potentially breaking change: 'cargo-clippy arg1 arg2...' will no longer ignore 'arg1' after edition=2024"
57+
);
58+
env::args().skip(2)
5259
} else {
5360
env::args().skip(2)
5461
};

0 commit comments

Comments
 (0)