Skip to content

Commit 0946056

Browse files
committed
Remove the "primary-and-stable" category.
It was only needed temporarily while doing the Great Benchmark Update of 2022.
1 parent ecb3ad7 commit 0946056

File tree

2 files changed

+8
-20
lines changed

2 files changed

+8
-20
lines changed

collector/src/execute.rs

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -107,42 +107,31 @@ fn touch_all(path: &Path) -> anyhow::Result<()> {
107107
Ok(())
108108
}
109109

110-
#[derive(Debug, Clone, Copy, Serialize, Deserialize, clap::ArgEnum)]
110+
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, clap::ArgEnum)]
111111
#[serde(rename_all = "kebab-case")]
112112
pub enum Category {
113113
Primary,
114114
Secondary,
115-
// FIXME: this should disappear after the 2022 benchmark overhaul is
116-
// complete.
117-
PrimaryAndStable,
118115
Stable,
119116
}
120117

121118
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
127121
}
128122

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
134125
}
135126

136127
// Within the DB, `Category` is represented in two fields:
137128
// - a `supports_stable` bool,
138129
// - a `category` which is either "primary" or "secondary".
139-
pub fn db_representation(&self) -> (bool, String) {
130+
pub fn db_representation(self) -> (bool, String) {
140131
match self {
141132
Category::Primary => (false, "primary".to_string()),
142133
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()),
146135
}
147136
}
148137
}
@@ -152,7 +141,6 @@ impl fmt::Display for Category {
152141
match self {
153142
Category::Primary => f.write_str("primary"),
154143
Category::Secondary => f.write_str("secondary"),
155-
Category::PrimaryAndStable => f.write_str("primary-and-stable"),
156144
Category::Stable => f.write_str("stable"),
157145
}
158146
}

collector/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ fn main_result() -> anyhow::Result<i32> {
10441044

10451045
// Exclude benchmarks that don't work with a stable compiler.
10461046
let mut benchmarks = get_benchmarks(&benchmark_dir, None, None)?;
1047-
benchmarks.retain(|b| b.category().has_stable());
1047+
benchmarks.retain(|b| b.category().is_stable());
10481048

10491049
let res = bench(
10501050
&mut rt,

0 commit comments

Comments
 (0)