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 { match value { - 0 => Err(CreationError::Zero), x if x < 0 => Err(CreationError::Negative), + 0 => Err(CreationError::Zero), x => Ok(PositiveNonzeroInteger(x as u64)), } }