1
0
mirror of https://github.com/rust-lang/rustlings.git synced 2025-06-23 00:28:46 +02:00

Address feedback

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

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()