summaryrefslogtreecommitdiff
path: root/exercises/13_error_handling
diff options
context:
space:
mode:
authorMatt Nield <64328730+matthewjnield@users.noreply.github.com>2024-07-05 16:04:07 -0400
committerGitHub <noreply@github.com>2024-07-05 16:04:07 -0400
commitfdada8b3d4f8a0d90804cae3e421875be76a109e (patch)
treee069c06c371e86ed8057c6245c4d48fc5d790637 /exercises/13_error_handling
parent9e2ff7d037a3c72ccedb7818350e98baca445506 (diff)
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.
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)),
}
}