mirror of
https://github.com/clap-rs/clap
synced 2024-09-22 07:11:56 +00:00
docs(examples): Remove unnecessary error check
Rather not confuse the point for users.
This commit is contained in:
parent
221c18bdec
commit
41d3b8f164
1 changed files with 2 additions and 1 deletions
|
@ -42,7 +42,8 @@ fn main() {
|
|||
.get_matches();
|
||||
|
||||
// Note that you don't have to specify the type since rustc can infer it for you
|
||||
let t = m.value_of_t("type").unwrap_or_else(|e| e.exit());
|
||||
// It's safe to call unwrap because the value is required and clap will report an error for us.
|
||||
let t = m.value_of_t("type").unwrap();
|
||||
|
||||
// Now we can use our enum like normal.
|
||||
match t {
|
||||
|
|
Loading…
Reference in a new issue