File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments