summaryrefslogtreecommitdiff
path: root/exercises/13_error_handling
diff options
context:
space:
mode:
Diffstat (limited to 'exercises/13_error_handling')
-rw-r--r--exercises/13_error_handling/errors5.rs2
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)),
}
}