Repository: dtolnay/cargo-expand (language: rust)

Issue:
--release flag is broken since cargo now ignores if used with --profile
<!--  ❤️  -->

```sh
$ cargo expand --release
warning: the `--release` flag should not be specified with the `--profile` flag
The `--release` flag will be ignored.
This was historically accepted, but will become an error in a future release
```


Discussion / hints:

Fix patch:
diff --git a/src/main.rs b/src/main.rs
index 01cf974..9f17e51 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -320,14 +320,12 @@ fn apply_args(cmd: &mut Command, args: &Expand, color: &Coloring, outfile: &Path
         line.arg(profile);
     } else if args.tests && args.test.is_none() {
         line.arg("test");
+    } else if args.release {
+        line.arg("release");
     } else {
         line.arg("check");
     }
 
-    if args.release {
-        line.arg("--release");
-    }
-
     if let Some(features) = &args.features {
         line.arg("--features");
         line.arg(features);


Test patch: