File tree Expand file tree Collapse file tree 5 files changed +7
-13
lines changed Expand file tree Collapse file tree 5 files changed +7
-13
lines changed Original file line number Diff line number Diff line change 13
13
// type goes where the question marks are, and how do we return
14
14
// that type from the body of read_and_validate?
15
15
//
16
- // Execute `rustlings hint errors4 ` for hints :)
16
+ // Execute `rustlings hint errorsn ` for hints :)
17
17
18
18
// I AM NOT DONE
19
19
Original file line number Diff line number Diff line change 1
1
// result1.rs
2
- // Make this test pass! Execute `rustlings hint option2 ` for hints :)
2
+ // Make this test pass! Execute `rustlings hint result1 ` for hints :)
3
3
4
4
// I AM NOT DONE
5
5
Original file line number Diff line number Diff line change 1
1
// functions1.rs
2
- // Make me compile! Execute `rustlings hint function1 ` for hints :)
2
+ // Make me compile! Execute `rustlings hint functions1 ` for hints :)
3
3
4
4
// I AM NOT DONE
5
5
Original file line number Diff line number Diff line change @@ -456,7 +456,7 @@ hint = """
456
456
If other functions can return a `Result`, why shouldn't `main`?"""
457
457
458
458
[[exercises ]]
459
- name = " errors4 "
459
+ name = " errorsn "
460
460
path = " exercises/error_handling/errorsn.rs"
461
461
mode = " test"
462
462
hint = """
@@ -507,7 +507,7 @@ Or use an `if let` statement on the result of `pop()` to both destructure
507
507
a `Some` value and only print out something if we have a value!"""
508
508
509
509
[[exercises ]]
510
- name = " option2 "
510
+ name = " result1 "
511
511
path = " exercises/error_handling/result1.rs"
512
512
mode = " test"
513
513
hint = """
Original file line number Diff line number Diff line change @@ -60,10 +60,7 @@ fn main() {
60
60
let exercises = toml:: from_str :: < ExerciseList > ( toml_str) . unwrap ( ) . exercises ;
61
61
62
62
if let Some ( ref matches) = matches. subcommand_matches ( "run" ) {
63
- let name = matches. value_of ( "name" ) . unwrap_or_else ( || {
64
- println ! ( "Please supply an exercise name!" ) ;
65
- std:: process:: exit ( 1 ) ;
66
- } ) ;
63
+ let name = matches. value_of ( "name" ) . unwrap ( ) ;
67
64
68
65
let matching_exercise = |e : & & Exercise | name == e. name ;
69
66
@@ -76,10 +73,7 @@ fn main() {
76
73
}
77
74
78
75
if let Some ( ref matches) = matches. subcommand_matches ( "hint" ) {
79
- let name = matches. value_of ( "name" ) . unwrap_or_else ( || {
80
- println ! ( "Please supply an exercise name!" ) ;
81
- std:: process:: exit ( 1 ) ;
82
- } ) ;
76
+ let name = matches. value_of ( "name" ) . unwrap ( ) ;
83
77
84
78
let exercise = exercises
85
79
. iter ( )
You can’t perform that action at this time.
0 commit comments