Skip to content

Commit fe77f0c

Browse files
authored
Merge pull request #76 from rodneylab/style__linting
style: 🛁 linting
2 parents 34634bc + 0e92aea commit fe77f0c

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

src/domain/semver/mod.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -425,24 +425,31 @@ impl Version {
425425
Op::Tilde => Self::tilde_range(*major, *minor, *patch),
426426
Op::Caret => Self::caret_range(*major, *minor, *patch),
427427
Op::Wildcard => Self::wildcard_range(*major, *minor, *patch),
428-
_ => unimplemented!(),
428+
_ => unimplemented!("Unsupported semver operator: `{op:?}`"),
429429
};
430430

431431
match op {
432-
Op::Exact | Op::Tilde | Op::Caret | Op::Wildcard | Op::Greater | Op::GreaterEq => {
432+
Op::Exact | Op::Tilde | Op::Caret | Op::Wildcard => {
433433
if range.start > start {
434434
start = range.start;
435435
}
436+
if range.end < end {
437+
end = range.end;
438+
}
436439
}
437-
_ => {}
438-
}
439-
match op {
440-
Op::Exact | Op::Tilde | Op::Caret | Op::Wildcard | Op::Less | Op::LessEq => {
440+
Op::Greater | Op::GreaterEq => {
441+
if range.start > start {
442+
start = range.start;
443+
}
444+
}
445+
Op::Less | Op::LessEq => {
441446
if range.end < end {
442447
end = range.end;
443448
}
444449
}
445-
_ => {}
450+
_ => unreachable!(
451+
"Previous match statement should cause a panic on non-implemented operations."
452+
),
446453
}
447454
}
448455

0 commit comments

Comments
 (0)