From 1a7bb5a4005e66665d2618b20bea132f009b79f9 Mon Sep 17 00:00:00 2001 From: marisa Date: Mon, 11 Nov 2019 17:47:45 +0100 Subject: [PATCH] Address feedback --- exercises/error_handling/errorsn.rs | 2 +- exercises/error_handling/result1.rs | 2 +- exercises/functions/functions1.rs | 2 +- info.toml | 4 ++-- src/main.rs | 10 ++-------- 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/exercises/error_handling/errorsn.rs b/exercises/error_handling/errorsn.rs index fc25308..3079943 100644 --- a/exercises/error_handling/errorsn.rs +++ b/exercises/error_handling/errorsn.rs @@ -13,7 +13,7 @@ // type goes where the question marks are, and how do we return // that type from the body of read_and_validate? // -// Execute `rustlings hint errors4` for hints :) +// Execute `rustlings hint errorsn` for hints :) // I AM NOT DONE diff --git a/exercises/error_handling/result1.rs b/exercises/error_handling/result1.rs index 352a6c2..b978001 100644 --- a/exercises/error_handling/result1.rs +++ b/exercises/error_handling/result1.rs @@ -1,5 +1,5 @@ // result1.rs -// Make this test pass! Execute `rustlings hint option2` for hints :) +// Make this test pass! Execute `rustlings hint result1` for hints :) // I AM NOT DONE diff --git a/exercises/functions/functions1.rs b/exercises/functions/functions1.rs index 49d48e9..3112527 100644 --- a/exercises/functions/functions1.rs +++ b/exercises/functions/functions1.rs @@ -1,5 +1,5 @@ // functions1.rs -// Make me compile! Execute `rustlings hint function1` for hints :) +// Make me compile! Execute `rustlings hint functions1` for hints :) // I AM NOT DONE diff --git a/info.toml b/info.toml index 84d5821..c7ad1e2 100644 --- a/info.toml +++ b/info.toml @@ -456,7 +456,7 @@ hint = """ If other functions can return a `Result`, why shouldn't `main`?""" [[exercises]] -name = "errors4" +name = "errorsn" path = "exercises/error_handling/errorsn.rs" mode = "test" hint = """ @@ -507,7 +507,7 @@ Or use an `if let` statement on the result of `pop()` to both destructure a `Some` value and only print out something if we have a value!""" [[exercises]] -name = "option2" +name = "result1" path = "exercises/error_handling/result1.rs" mode = "test" hint = """ 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::(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()