33 serde:: Deserialize ,
44} ;
55
6- #[ derive( Debug ) ]
7- pub enum SemverGroupVariant {
8- Disabled ,
9- Ignored ,
10- WithRange ,
11- }
12-
136#[ derive( Debug ) ]
147pub struct SemverGroup {
15- /// What behaviour has this group been configured to exhibit?
16- pub variant : SemverGroupVariant ,
178 /// Data to determine which instances should be added to this group
189 pub selector : GroupSelector ,
1910 /// The Semver Range which all instances in this group should use
@@ -24,7 +15,6 @@ impl SemverGroup {
2415 /// Create a default group which ensures local packages are an exact version
2516 pub fn get_exact_local_specifiers ( ) -> SemverGroup {
2617 SemverGroup {
27- variant : SemverGroupVariant :: WithRange ,
2818 selector : GroupSelector :: new (
2919 /* all_packages: */ & Packages :: new ( ) ,
3020 /* include_dependencies: */ vec ! [ ] ,
@@ -40,7 +30,6 @@ impl SemverGroup {
4030 /// Create a default/catch-all group which would apply to any instance
4131 pub fn get_catch_all ( ) -> SemverGroup {
4232 SemverGroup {
43- variant : SemverGroupVariant :: Disabled ,
4433 selector : GroupSelector :: new (
4534 /* all_packages: */ & Packages :: new ( ) ,
4635 /* include_dependencies: */ vec ! [ ] ,
@@ -65,20 +54,11 @@ impl SemverGroup {
6554 ) ;
6655
6756 if let Some ( true ) = group. is_disabled {
68- SemverGroup {
69- variant : SemverGroupVariant :: Disabled ,
70- selector,
71- range : None ,
72- }
57+ SemverGroup { selector, range : None }
7358 } else if let Some ( true ) = group. is_ignored {
74- SemverGroup {
75- variant : SemverGroupVariant :: Ignored ,
76- selector,
77- range : None ,
78- }
59+ SemverGroup { selector, range : None }
7960 } else if let Some ( range) = & group. range {
8061 SemverGroup {
81- variant : SemverGroupVariant :: WithRange ,
8262 selector,
8363 range : SemverRange :: new ( range) ,
8464 }
0 commit comments