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:
10
src/main.rs
10
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()
|
||||
|
Reference in New Issue
Block a user