Skip to content

Commit

Permalink
Fix clippy::redundant_guards warning
Browse files Browse the repository at this point in the history
```
error: redundant guard
   --> src/main.rs:652:20
    |
652 |         Some(p) if matches!(p, "release" | "bench") => "release",
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards
    = note: `-D clippy::redundant-guards` implied by `-D warnings`
help: try
    |
652 -         Some(p) if matches!(p, "release" | "bench") => "release",
652 +         Some("release" | "bench") => "release",
    |

error: redundant guard
   --> src/main.rs:653:20
    |
653 |         Some(p) if matches!(p, "dev" | "test") => "debug",
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards
help: try
    |
653 -         Some(p) if matches!(p, "dev" | "test") => "debug",
653 +         Some("dev" | "test") => "debug",
    |
```
  • Loading branch information
taiki-e committed Aug 2, 2023
1 parent 9079470 commit acba1e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,8 @@ fn object_files(cx: &Context) -> Result<Vec<OsString>> {
let profile = match cx.args.profile.as_deref() {
None if cx.args.release => "release",
None => "debug",
Some(p) if matches!(p, "release" | "bench") => "release",
Some(p) if matches!(p, "dev" | "test") => "debug",
Some("release" | "bench") => "release",
Some("dev" | "test") => "debug",
Some(p) => p,
};
target_dir.push(profile);
Expand Down

0 comments on commit acba1e5

Please sign in to comment.