@@ -107,42 +107,31 @@ fn touch_all(path: &Path) -> anyhow::Result<()> {
107
107
Ok ( ( ) )
108
108
}
109
109
110
- #[ derive( Debug , Clone , Copy , Serialize , Deserialize , clap:: ArgEnum ) ]
110
+ #[ derive( Debug , Clone , Copy , PartialEq , Serialize , Deserialize , clap:: ArgEnum ) ]
111
111
#[ serde( rename_all = "kebab-case" ) ]
112
112
pub enum Category {
113
113
Primary ,
114
114
Secondary ,
115
- // FIXME: this should disappear after the 2022 benchmark overhaul is
116
- // complete.
117
- PrimaryAndStable ,
118
115
Stable ,
119
116
}
120
117
121
118
impl Category {
122
- pub fn has_stable ( & self ) -> bool {
123
- match self {
124
- Category :: Primary | Category :: Secondary => false ,
125
- Category :: PrimaryAndStable | Category :: Stable => true ,
126
- }
119
+ pub fn is_stable ( self ) -> bool {
120
+ self == Category :: Stable
127
121
}
128
122
129
- pub fn is_primary_or_secondary ( & self ) -> bool {
130
- match self {
131
- Category :: Primary | Category :: Secondary | Category :: PrimaryAndStable => true ,
132
- Category :: Stable => false ,
133
- }
123
+ pub fn is_primary_or_secondary ( self ) -> bool {
124
+ self == Category :: Primary || self == Category :: Secondary
134
125
}
135
126
136
127
// Within the DB, `Category` is represented in two fields:
137
128
// - a `supports_stable` bool,
138
129
// - a `category` which is either "primary" or "secondary".
139
- pub fn db_representation ( & self ) -> ( bool , String ) {
130
+ pub fn db_representation ( self ) -> ( bool , String ) {
140
131
match self {
141
132
Category :: Primary => ( false , "primary" . to_string ( ) ) ,
142
133
Category :: Secondary => ( false , "secondary" . to_string ( ) ) ,
143
- // These two have the same DB representation, even though they are
144
- // treated differently when choosing which benchmarks to run.
145
- Category :: PrimaryAndStable | Category :: Stable => ( true , "primary" . to_string ( ) ) ,
134
+ Category :: Stable => ( true , "primary" . to_string ( ) ) ,
146
135
}
147
136
}
148
137
}
@@ -152,7 +141,6 @@ impl fmt::Display for Category {
152
141
match self {
153
142
Category :: Primary => f. write_str ( "primary" ) ,
154
143
Category :: Secondary => f. write_str ( "secondary" ) ,
155
- Category :: PrimaryAndStable => f. write_str ( "primary-and-stable" ) ,
156
144
Category :: Stable => f. write_str ( "stable" ) ,
157
145
}
158
146
}
0 commit comments