Add solutions
This commit is contained in:
parent
7417f01d5d
commit
b056b6ad81
96 changed files with 229 additions and 166 deletions
|
|
@ -59,7 +59,10 @@ 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