Address feedback

This commit is contained in:
marisa committed 2019-11-11 17:47:45 +01:00
1 parent 48c35bcfbc
commit 1a7bb5a400
5 files changed
+7 -13

No files matched your search

+2 -8
View File
@@ -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()