diff options
| author | mokou <mokou@fastmail.com> | 2022-07-15 14:31:49 +0200 |
|---|---|---|
| committer | mokou <mokou@fastmail.com> | 2022-07-15 14:31:49 +0200 |
| commit | c791cf4232fbfc313279b19b483c1adbca1c6862 (patch) | |
| tree | 655ad6c9d33dab11dfd70f28d0ec29d03749a70b /exercises/error_handling/errors6.rs | |
| parent | f1c4caa37fe5027d121aec6433dee85433d9329d (diff) | |
| parent | c265b681b188ea21b3f8585e65ea363fc02c4b50 (diff) | |
Merge branch '5.0-dev'
Diffstat (limited to 'exercises/error_handling/errors6.rs')
| -rw-r--r-- | exercises/error_handling/errors6.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/exercises/error_handling/errors6.rs b/exercises/error_handling/errors6.rs index 847a049..1306fb0 100644 --- a/exercises/error_handling/errors6.rs +++ b/exercises/error_handling/errors6.rs @@ -6,7 +6,7 @@ // we define a custom error type to make it possible for callers to decide // what to do next when our function returns an error. -// Make these tests pass! Execute `rustlings hint errors6` for hints :) +// Execute `rustlings hint errors6` or use the `hint` watch subcommand for a hint. // I AM NOT DONE @@ -20,7 +20,11 @@ enum ParsePosNonzeroError { } impl ParsePosNonzeroError { + fn from_creation(err: CreationError) -> ParsePosNonzeroError { + ParsePosNonzeroError::Creation(err) + } // TODO: add another error conversion function here. + // fn from_parseint... } fn parse_pos_nonzero(s: &str) |
