diff options
| author | Jakob Degen <jakob.e.degen@gmail.com> | 2022-04-16 18:44:27 -0400 |
|---|---|---|
| committer | Jakob Degen <jakob.e.degen@gmail.com> | 2022-04-16 18:44:27 -0400 |
| commit | 4534188d4ba3d4b7475c5f9e8b275ebec2b810e8 (patch) | |
| tree | c91f7c29d157855fc2772793b144d3ea61284fd4 /compiler/rustc_session/src | |
| parent | 699bf7dc593bd8f49d0dadfb435dadfc6952084a (diff) | |
| download | rust-4534188d4ba3d4b7475c5f9e8b275ebec2b810e8.tar.gz rust-4534188d4ba3d4b7475c5f9e8b275ebec2b810e8.zip | |
Address nits
Diffstat (limited to 'compiler/rustc_session/src')
| -rw-r--r-- | compiler/rustc_session/src/options.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs index a5c1c713bfc..0b7ab293fcf 100644 --- a/compiler/rustc_session/src/options.rs +++ b/compiler/rustc_session/src/options.rs @@ -536,11 +536,8 @@ mod parse { match v { Some(s) => { for s in s.split(",") { - match s.chars().next() { - Some('+') => slot.push((s[1..].to_string(), true)), - Some('-') => slot.push((s[1..].to_string(), false)), - _ => return false, - } + let Some(pass_name) = s.strip_prefix(&['+', '-'][..]) else { return false }; + slot.push((pass_name.to_string(), &s[..1] == "+")); } true } |
