1-46
This commit is contained in:
parent
e8f09190d6
commit
5b51d6f393
46 changed files with 83 additions and 65 deletions
|
|
@ -59,7 +59,13 @@ fn fixTooSmall(n: u32) MyNumberError!u32 {
|
|||
// If we get a TooSmall error, we should return 10.
|
||||
// If we get any other error, we should return that error.
|
||||
// Otherwise, we return the u32 number.
|
||||
return detectProblems(n) ???;
|
||||
return detectProblems(n) catch |err| {
|
||||
if (err == MyNumberError.TooSmall) {
|
||||
return 10;
|
||||
}
|
||||
|
||||
return err;
|
||||
};
|
||||
}
|
||||
|
||||
fn detectProblems(n: u32) MyNumberError!u32 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue