1
Fork 0

match on chars instead of &strs for .split() or .strip_prefix()

This commit is contained in:
Matthias Krüger 2023-07-23 10:12:40 +02:00
parent cec34a43b1
commit 7a7708904b
5 changed files with 7 additions and 7 deletions

View file

@ -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(())

View file

@ -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;
}