match on chars instead of &strs for .split() or .strip_prefix()
This commit is contained in:
parent
cec34a43b1
commit
7a7708904b
5 changed files with 7 additions and 7 deletions
|
@ -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(())
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue