Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
marisa committed Nov 11, 2019
1 parent 48c35bc commit 1a7bb5a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion exercises/error_handling/errorsn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion exercises/error_handling/result1.rs
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion exercises/functions/functions1.rs
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions info.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """
Expand Down Expand Up @@ -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 = """
Expand Down
10 changes: 2 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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()
Expand Down

0 comments on commit 1a7bb5a

Please sign in to comment.