We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9e2ff7d + fdada8b commit c9017f9Copy full SHA for c9017f9
exercises/13_error_handling/errors5.rs
@@ -39,8 +39,8 @@ struct PositiveNonzeroInteger(u64);
39
impl PositiveNonzeroInteger {
40
fn new(value: i64) -> Result<PositiveNonzeroInteger, CreationError> {
41
match value {
42
- 0 => Err(CreationError::Zero),
43
x if x < 0 => Err(CreationError::Negative),
+ 0 => Err(CreationError::Zero),
44
x => Ok(PositiveNonzeroInteger(x as u64)),
45
}
46
0 commit comments