diff --git a/examples/13_enum_values.rs b/examples/13_enum_values.rs index 8c0a99f3..d6b3be30 100644 --- a/examples/13_enum_values.rs +++ b/examples/13_enum_values.rs @@ -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 {