From f4bbc8f2c81bb39ce5e909c80a30e6e810658740 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 1 Aug 2023 20:47:50 -0700 Subject: [PATCH] Resolve redundant_guards clippy lint 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() { | --- build/rustc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/rustc.rs b/build/rustc.rs index 71a830b..eb072e4 100644 --- a/build/rustc.rs +++ b/build/rustc.rs @@ -57,9 +57,9 @@ fn parse_words(words: &mut dyn Iterator) -> Option { 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(')') => {