docs(examples): Remove unnecessary error check

Rather not confuse the point for users.
This commit is contained in:
Ed Page 2021-11-12 08:32:22 -06:00
parent 221c18bdec
commit 41d3b8f164

View file

@ -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 {