Skip to content

Conversation

@dsgallups
Copy link
Contributor

@dsgallups dsgallups commented Jan 19, 2026

This is a small QOL adjustment that allows you to quickly pattern match on a CLI argument. i.e.

match vars.cli_arg("foo")? {
  "apple" => ...
  "banana" => ...
  _ => ...
}

Sometimes when the value is optional...

match vars.cli_arg("foo") {
  Ok( "apple") => ...
  Ok(_) => ...
  Err(e) => ...
}

I don't see any particular behavior that would be lost from auto-dereffing the String here. It seems that &str is more often more useful than &String.

This is a QOL fix that allows you to quickly pattern match on a CLI
argument. i.e.
```rust
match vars.cli_arg("foo")? {
  "apple" => ...
  "banana" => ...
  _ => ...
}
```
@dsgallups dsgallups changed the title refactor: Vars::cli_arg returns Result<&str> refactor: Vars::cli_arg returns Result<&str> Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant