Skip to content

Commit 693c978

Browse files
refactor: migrate from strum::{EnumIter,IntoEnumIterator} to exhaust::Exhaust (#200)
* refactor: migrate from `strum::{EnumIter,IntoEnumIterator}` to `exhaust::Exhaust` * chore: update direct `itertools` usage 0.11.0 → 0.14.0
1 parent 96b5054 commit 693c978

4 files changed

Lines changed: 49 additions & 39 deletions

File tree

Cargo.lock

Lines changed: 41 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

moz-webgpu-cts/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ clap = { version = "4.4.2", features = ["derive"] }
2323
enum-map = { version = "2.7.3", features = ["serde"] }
2424
enumset = { version = "1.1.3", features = ["serde"] }
2525
env_logger = { workspace = true }
26+
exhaust = "0.2.5"
2627
indexmap = { workspace = true }
27-
itertools = "0.11.0"
28+
itertools = "0.14.0"
2829
joinery = "3.1.0"
2930
lazy_format = { workspace = true }
3031
lets_find_up = "0.0.3"
@@ -35,7 +36,6 @@ path-dsl = "0.6.1"
3536
rayon = "1.8.0"
3637
serde = { workspace = true, features = ["derive"] }
3738
serde_json = "1.0.107"
38-
strum = { version = "0.27.1", features = ["derive"] }
3939
thiserror = { workspace = true }
4040
wax = { version = "0.6.0", features = [
4141
"miette",

moz-webgpu-cts/src/wpt/metadata.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ use std::{
77
use clap::ValueEnum;
88
use enum_map::Enum;
99
use enumset::EnumSetType;
10+
use exhaust::Exhaust;
1011
use joinery::JoinableIterator;
1112
use lazy_format::{lazy_format, make_lazy_format};
1213
use maybe_collapsed::MaybeCollapsed;
1314
use serde::{Deserialize, Serialize};
14-
use strum::EnumIter;
1515
use whippit::{
1616
metadata::{
1717
self, file_parser,
@@ -906,14 +906,14 @@ where
906906
})
907907
}
908908

909-
#[derive(Clone, Copy, Debug, Enum, EnumIter, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
909+
#[derive(Clone, Copy, Debug, Enum, Exhaust, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
910910
pub enum Platform {
911911
Windows,
912912
Linux,
913913
MacOs,
914914
}
915915

916-
#[derive(Clone, Copy, Debug, Enum, EnumIter, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
916+
#[derive(Clone, Copy, Debug, Enum, Exhaust, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
917917
pub enum BuildProfile {
918918
Debug,
919919
Optimized,

moz-webgpu-cts/src/wpt/path.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ use std::{
66

77
use camino::{Utf8Component, Utf8Path};
88
use clap::ValueEnum;
9+
use exhaust::Exhaust;
910
use itertools::Itertools;
1011
use joinery::JoinableIterator;
1112
use lazy_format::make_lazy_format;
12-
use strum::{EnumIter, IntoEnumIterator};
1313

1414
/// A browser supported by [crate::main], used for [`TestEntryPath`]s.
1515
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, ValueEnum)]
@@ -173,7 +173,7 @@ impl TestEntryType {
173173
fn iter() -> impl Iterator<Item = Self> {
174174
// NOTE: `Html`'s file extension is less specific than other file extensions, so try
175175
// matching it last.
176-
JsExecScope::iter()
176+
JsExecScope::exhaust()
177177
.map(|exec_scope| Self::Js { exec_scope })
178178
.chain([Self::Html])
179179
}
@@ -204,7 +204,7 @@ impl TestEntryType {
204204
}
205205

206206
/// An executed JS test entry's test type, viz.,
207-
#[derive(Clone, Copy, Debug, EnumIter, Eq, Hash, Ord, PartialEq, PartialOrd)]
207+
#[derive(Clone, Copy, Debug, Exhaust, Eq, Hash, Ord, PartialEq, PartialOrd)]
208208
pub(crate) enum JsExecScope {
209209
/// A `*.worker.js` test. See also [WPT upstream docs.' "Dedicated worker test (`.worker.js`)"
210210
/// section][upstream].

0 commit comments

Comments
 (0)