summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormarisa <mokou@posteo.de>2019-11-11 17:47:45 +0100
committermarisa <mokou@posteo.de>2019-11-11 17:47:45 +0100
commit1a7bb5a4005e66665d2618b20bea132f009b79f9 (patch)
treedbdd23fad66b796a9fefc04174b50566a7d269a1 /src
parent48c35bcfbc251bcfc8d8a2abaa141e260209c285 (diff)
Address feedback
Diffstat (limited to 'src')
-rw-r--r--src/main.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/main.rs b/src/main.rs
index 5a4af53..d1d0d6d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -60,10 +60,7 @@ fn main() {
let exercises = toml::from_str::<ExerciseList>(toml_str).unwrap().exercises;
if let Some(ref matches) = matches.subcommand_matches("run") {
- let name = matches.value_of("name").unwrap_or_else(|| {
- println!("Please supply an exercise name!");
- std::process::exit(1);
- });
+ let name = matches.value_of("name").unwrap();
let matching_exercise = |e: &&Exercise| name == e.name;
@@ -76,10 +73,7 @@ fn main() {
}
if let Some(ref matches) = matches.subcommand_matches("hint") {
- let name = matches.value_of("name").unwrap_or_else(|| {
- println!("Please supply an exercise name!");
- std::process::exit(1);
- });
+ let name = matches.value_of("name").unwrap();
let exercise = exercises
.iter()