diff options
| author | Mo <76752051+mo8it@users.noreply.github.com> | 2024-07-06 13:25:03 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-06 13:25:03 +0200 |
| commit | c9017f9f7a46eab2a75d89a7bc36345ea88cc654 (patch) | |
| tree | e069c06c371e86ed8057c6245c4d48fc5d790637 | |
| parent | 9e2ff7d037a3c72ccedb7818350e98baca445506 (diff) | |
| parent | fdada8b3d4f8a0d90804cae3e421875be76a109e (diff) | |
Merge pull request #2022 from matthewjnield/main
chore: Update errors5.rs exercise to be consistent with solution
| -rw-r--r-- | exercises/13_error_handling/errors5.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/exercises/13_error_handling/errors5.rs b/exercises/13_error_handling/errors5.rs index d0044db..5721835 100644 --- a/exercises/13_error_handling/errors5.rs +++ b/exercises/13_error_handling/errors5.rs @@ -39,8 +39,8 @@ struct PositiveNonzeroInteger(u64); impl PositiveNonzeroInteger { fn new(value: i64) -> Result<PositiveNonzeroInteger, CreationError> { match value { - 0 => Err(CreationError::Zero), x if x < 0 => Err(CreationError::Negative), + 0 => Err(CreationError::Zero), x => Ok(PositiveNonzeroInteger(x as u64)), } } |
