diff options
| author | mo8it <mo8it@proton.me> | 2024-06-27 01:12:50 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-06-27 01:12:50 +0200 |
| commit | b1daea1fe8536d7b7b4463cb8fc36d69848ef77a (patch) | |
| tree | 45cd0559e57354a06ad76cef54024faa7a735d25 /rustlings-macros | |
| parent | 129884aff74964d13aba8309014554b5625d6e5b (diff) | |
errors6 solution
Diffstat (limited to 'rustlings-macros')
| -rw-r--r-- | rustlings-macros/info.toml | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/rustlings-macros/info.toml b/rustlings-macros/info.toml index 700c179..dc288c0 100644 --- a/rustlings-macros/info.toml +++ b/rustlings-macros/info.toml @@ -714,17 +714,13 @@ https://doc.rust-lang.org/stable/rust-by-example/error/multiple_error_types/reen name = "errors6" dir = "13_error_handling" hint = """ -This exercise uses a completed version of `PositiveNonzeroInteger` from -errors4. +This exercise uses a completed version of `PositiveNonzeroInteger` from the +previous exercises. Below the line that `TODO` asks you to change, there is an example of using the `map_err()` method on a `Result` to transform one type of error into another. Try using something similar on the `Result` from `parse()`. You -might use the `?` operator to return early from the function, or you might -use a `match` expression, or maybe there's another way! - -You can create another function inside `impl ParsePosNonzeroError` to use -with `map_err()`. +can then use the `?` operator to return early. Read more about `map_err()` in the `std::result` documentation: https://doc.rust-lang.org/std/result/enum.Result.html#method.map_err""" |
