Skip to content

Commit

Permalink
Tweak OsStringExt::parse() explanation
Browse files Browse the repository at this point in the history
Closes #19.
  • Loading branch information
blyxxyz committed Aug 5, 2023
1 parent e9cba2e commit 9f04127
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Let's walk through this:
- We match on arguments. `Short` and `Long` indicate an option.
- To get the value that belongs to an option (like `10` in `-n 10`) we call `parser.value()`.
- This returns a standard [`OsString`](https://doc.rust-lang.org/std/ffi/struct.OsString.html).
- For convenience, `use lexopt::prelude::*` adds a `.parse()` method, analogous to [`str::parse`](https://doc.rust-lang.org/std/primitive.str.html#method.parse).
- For convenience, `use lexopt::prelude::*` adds a `.parse()` method, analogous to [the one on `&str`](https://doc.rust-lang.org/std/primitive.str.html#method.parse).
- Calling `parser.value()` is how we tell `Parser` that `-n` takes a value at all.
- `Value` indicates a free-standing argument.
- `if thing.is_none()` is a useful pattern for positional arguments. If we already found `thing` we pass it on to another case.
Expand Down

0 comments on commit 9f04127

Please sign in to comment.