Skip to content

Commit dee2db8

Browse files
chore(deps): lock file maintenance rust crates (oxc-project#10400)
1 parent 4c246fb commit dee2db8

File tree

3 files changed

+62
-77
lines changed

3 files changed

+62
-77
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ rayon = "1.10.0"
211211
ropey = "1.6.1"
212212
rust-lapper = "1.1.0"
213213
ryu-js = "1.0.2"
214-
saphyr = "0.0.3"
214+
saphyr = "0.0.4"
215215
schemars = "0.8.22"
216216
self_cell = "1.1.0"
217217
seq-macro = "0.3.6"

tasks/coverage/src/test262/meta.rs

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use saphyr::Yaml;
1+
use saphyr::{LoadableYamlNode, Yaml};
22

33
#[derive(Debug, Clone, Default)]
44
pub struct MetaData {
@@ -91,24 +91,35 @@ impl MetaData {
9191
let Some(yaml) = yamls.first() else { return Self::default() };
9292
Self {
9393
// description: yaml["description"].as_str().unwrap_or_default().into(),
94-
esid: yaml["esid"].as_str().map(Into::into),
94+
esid: yaml
95+
.as_mapping_get("esid")
96+
.and_then(|v| v.as_str())
97+
.map(|s| s.to_string().into_boxed_str()),
9598
// es5id: yaml["es5id"].as_str().map(Into::into),
9699
// es6id: yaml["es6id"].as_str().map(Into::into),
97100
// info: yaml["info"].as_str().unwrap_or_default().into(),
98-
features: Self::get_vec_of_string(&yaml["features"]),
99-
includes: Self::get_vec_of_string(&yaml["includes"]),
100-
flags: yaml["flags"]
101-
.as_vec()
102-
.map_or_else(Vec::new, |a| {
103-
a.iter()
101+
features: yaml
102+
.as_mapping_get("features")
103+
.map(Self::get_vec_of_string)
104+
.unwrap_or_default(),
105+
includes: yaml
106+
.as_mapping_get("includes")
107+
.map(Self::get_vec_of_string)
108+
.unwrap_or_default(),
109+
flags: yaml
110+
.as_mapping_get("flags")
111+
.and_then(|v| v.as_vec())
112+
.map(|vec| {
113+
vec.iter()
104114
.map(|v| v.as_str().map(TestFlag::from_str).unwrap())
105115
.collect::<Vec<_>>()
116+
.into_boxed_slice()
106117
})
107-
.into(),
108-
negative: {
109-
let yaml = &yaml["negative"];
110-
(!yaml.is_null() && !yaml.is_badvalue()).then(|| Negative::from_yaml(yaml))
111-
},
118+
.unwrap_or_default(),
119+
negative: yaml
120+
.as_mapping_get("negative")
121+
.filter(|yaml| (!yaml.is_null() && !yaml.is_badvalue()))
122+
.map(|yaml| Negative::from_yaml(yaml)),
112123
// locale: Self::get_vec_of_string(&yaml["locale"]),
113124
}
114125
}

0 commit comments

Comments
 (0)