Skip to content

Commit 0cbdea5

Browse files
authored
Merge pull request #1542 from fitzgen/update-walrus
Update dependencies and use new walrus custom sections APIs
2 parents fb42e47 + d422436 commit 0cbdea5

File tree

7 files changed

+14
-20
lines changed

7 files changed

+14
-20
lines changed

crates/anyref-xform/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ edition = '2018'
1313

1414
[dependencies]
1515
failure = "0.1"
16-
walrus = "0.6"
16+
walrus = "0.7.0"

crates/cli-support/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ log = "0.4"
1818
rustc-demangle = "0.1.13"
1919
serde_json = "1.0"
2020
tempfile = "3.0"
21-
walrus = "0.6.0"
21+
walrus = "0.7.0"
2222
wasm-bindgen-anyref-xform = { path = '../anyref-xform', version = '=0.2.44' }
2323
wasm-bindgen-shared = { path = "../shared", version = '=0.2.44' }
2424
wasm-bindgen-threads-xform = { path = '../threads-xform', version = '=0.2.44' }

crates/cli-support/src/lib.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -508,20 +508,14 @@ fn extract_programs<'a>(
508508
program_storage: &'a mut Vec<Vec<u8>>,
509509
) -> Result<Vec<decode::Program<'a>>, Error> {
510510
let my_version = wasm_bindgen_shared::version();
511-
let mut to_remove = Vec::new();
512511
assert!(program_storage.is_empty());
513512

514-
for (i, custom) in module.custom.iter_mut().enumerate() {
515-
if custom.name != "__wasm_bindgen_unstable" {
516-
continue;
517-
}
518-
to_remove.push(i);
519-
log::debug!("custom section {} looks like a wasm bindgen section", i);
520-
program_storage.push(mem::replace(&mut custom.value, Vec::new()));
521-
}
522-
523-
for i in to_remove.into_iter().rev() {
524-
module.custom.remove(i);
513+
while let Some(raw) = module.customs.remove_raw("__wasm_bindgen_unstable") {
514+
log::debug!(
515+
"custom section '{}' looks like a wasm bindgen section",
516+
raw.name
517+
);
518+
program_storage.push(raw.data);
525519
}
526520

527521
let mut ret = Vec::new();

crates/cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ rouille = { version = "3.0.0", default-features = false }
2424
serde = { version = "1.0", features = ['derive'] }
2525
serde_derive = "1.0"
2626
serde_json = "1.0"
27-
walrus = "0.6"
27+
walrus = "0.7.0"
2828
wasm-bindgen-cli-support = { path = "../cli-support", version = "=0.2.44" }
2929
wasm-bindgen-shared = { path = "../shared", version = "=0.2.44" }
3030

crates/cli/src/bin/wasm-bindgen-test-runner/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ fn rmain() -> Result<(), Error> {
9494
// `wasm_bindgen_test_configure` macro, which emits a custom section for us
9595
// to read later on.
9696
let mut node = true;
97-
for custom in wasm.custom.iter() {
98-
if custom.name != "__wasm_bindgen_test_unstable" {
97+
for (_id, custom) in wasm.customs.iter() {
98+
if custom.name() != "__wasm_bindgen_test_unstable" {
9999
continue;
100100
}
101-
node = !custom.value.contains(&0x01);
101+
node = !custom.data().contains(&0x01);
102102
}
103103
let headless = env::var("NO_HEADLESS").is_err();
104104
let debug = env::var("WASM_BINDGEN_NO_DEBUG").is_err();

crates/threads-xform/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ edition = "2018"
1313

1414
[dependencies]
1515
failure = "0.1"
16-
walrus = "0.6"
16+
walrus = "0.7.0"

crates/wasm-interpreter/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ edition = '2018'
1414
[dependencies]
1515
failure = "0.1"
1616
log = "0.4"
17-
walrus = "0.6"
17+
walrus = "0.7.0"
1818

1919
[dev-dependencies]
2020
tempfile = "3"

0 commit comments

Comments
 (0)