diff options
| author | Yotam Ofek <yotam.ofek@gmail.com> | 2025-03-28 12:21:21 +0000 |
|---|---|---|
| committer | Yotam Ofek <yotam.ofek@gmail.com> | 2025-03-28 12:21:21 +0000 |
| commit | 9ef35ddc0ca236db91d444a31de5fc8ac835ce9b (patch) | |
| tree | 32bbf5d10c166dd747d79dbe931a223eb24f33e3 /compiler/rustc_session/src/utils.rs | |
| parent | e77a8f439cc87c5d67b007e9811578533de1de91 (diff) | |
| download | rust-9ef35ddc0ca236db91d444a31de5fc8ac835ce9b.tar.gz rust-9ef35ddc0ca236db91d444a31de5fc8ac835ce9b.zip | |
use `slice::contains` where applicable
Diffstat (limited to 'compiler/rustc_session/src/utils.rs')
| -rw-r--r-- | compiler/rustc_session/src/utils.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/rustc_session/src/utils.rs b/compiler/rustc_session/src/utils.rs index fcede379b89..2243e831b66 100644 --- a/compiler/rustc_session/src/utils.rs +++ b/compiler/rustc_session/src/utils.rs @@ -149,14 +149,15 @@ pub fn extra_compiler_flags() -> Option<(Vec<String>, bool)> { arg[a.len()..].to_string() }; let option = content.split_once('=').map(|s| s.0).unwrap_or(&content); - if ICE_REPORT_COMPILER_FLAGS_EXCLUDE.iter().any(|exc| option == *exc) { + if ICE_REPORT_COMPILER_FLAGS_EXCLUDE.contains(&option) { excluded_cargo_defaults = true; } else { result.push(a.to_string()); - match ICE_REPORT_COMPILER_FLAGS_STRIP_VALUE.iter().find(|s| option == **s) { - Some(s) => result.push(format!("{s}=[REDACTED]")), - None => result.push(content), - } + result.push(if ICE_REPORT_COMPILER_FLAGS_STRIP_VALUE.contains(&option) { + format!("{option}=[REDACTED]") + } else { + content + }); } } } |
