Skip to content

Commit fdada8b

Browse files
chore: Update errors5.rs exercise to be consistent with solution
In errors5.rs, there are two lines of a pattern matching block for which the order is reversed between the exercise file and the solution file. Since these lines are not changed as part of the exercise, this commit updates the exercise to make the order of the lines consistent with the solution, so that users will focus only on the lines that change between the exercise and the solution.
1 parent 9e2ff7d commit fdada8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exercises/13_error_handling/errors5.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ struct PositiveNonzeroInteger(u64);
3939
impl PositiveNonzeroInteger {
4040
fn new(value: i64) -> Result<PositiveNonzeroInteger, CreationError> {
4141
match value {
42-
0 => Err(CreationError::Zero),
4342
x if x < 0 => Err(CreationError::Negative),
43+
0 => Err(CreationError::Zero),
4444
x => Ok(PositiveNonzeroInteger(x as u64)),
4545
}
4646
}

0 commit comments

Comments
 (0)