diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-07-23 10:12:40 +0200 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2023-07-23 10:13:41 +0200 |
| commit | 7a7708904bf69c8f85a41efea1db4cd5ebc6fecb (patch) | |
| tree | 68f28315b7128a6fdcf28f8d851ba66028fca7b8 /compiler/rustc_session/src | |
| parent | cec34a43b1b14f4e39363f3b283d7ac4f593ee81 (diff) | |
| download | rust-7a7708904bf69c8f85a41efea1db4cd5ebc6fecb.tar.gz rust-7a7708904bf69c8f85a41efea1db4cd5ebc6fecb.zip | |
match on chars instead of &strs for .split() or .strip_prefix()
Diffstat (limited to 'compiler/rustc_session/src')
| -rw-r--r-- | compiler/rustc_session/src/config.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_session/src/options.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index a8147ede970..36b5c385ab1 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -279,11 +279,11 @@ impl LinkSelfContained { // set of all values like `y` or `n` used to be. Therefore, if this flag had previously been // set in bulk with its historical values, then manually setting a component clears that // `explicitly_set` state. - if let Some(component_to_enable) = component.strip_prefix("+") { + if let Some(component_to_enable) = component.strip_prefix('+') { self.explicitly_set = None; self.components.insert(component_to_enable.parse()?); Ok(()) - } else if let Some(component_to_disable) = component.strip_prefix("-") { + } else if let Some(component_to_disable) = component.strip_prefix('-') { self.explicitly_set = None; self.components.remove(component_to_disable.parse()?); Ok(()) diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs index 39efe9abeec..ff433fdf16d 100644 --- a/compiler/rustc_session/src/options.rs +++ b/compiler/rustc_session/src/options.rs @@ -1145,7 +1145,7 @@ mod parse { } // 2. Parse a list of enabled and disabled components. - for comp in s.split(",") { + for comp in s.split(',') { if slot.handle_cli_component(comp).is_err() { return false; } |
