Skip to content

Commit

Permalink
Resolve redundant_guards clippy lint
Browse files Browse the repository at this point in the history
    warning: redundant guard
      --> build/rustc.rs:60:26
       |
    60 |         Some(channel) if channel == "dev" => Dev,
       |                          ^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards
       = note: `-W clippy::redundant-guards` implied by `-W clippy::all`
    help: try
       |
    60 -         Some(channel) if channel == "dev" => Dev,
    60 +         Some("dev") => Dev,
       |

    warning: redundant guard
      --> build/rustc.rs:62:26
       |
    62 |         Some(channel) if channel == "nightly" => match words.next() {
       |                          ^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards
    help: try
       |
    62 -         Some(channel) if channel == "nightly" => match words.next() {
    62 +         Some("nightly") => match words.next() {
       |
  • Loading branch information
dtolnay committed Aug 2, 2023
1 parent dda672e commit f4bbc8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ fn parse_words(words: &mut dyn Iterator<Item = &str>) -> Option<Version> {

let channel = match channel {
None => Stable,
Some(channel) if channel == "dev" => Dev,
Some("dev") => Dev,
Some(channel) if channel.starts_with("beta") => Beta,
Some(channel) if channel == "nightly" => match words.next() {
Some("nightly") => match words.next() {
Some(hash) if hash.starts_with('(') => match words.next() {
None if hash.ends_with(')') => Dev,
Some(date) if date.ends_with(')') => {
Expand Down

0 comments on commit f4bbc8f

Please sign in to comment.