rustwasm / wasm-webidl-bindings

Read, write, and manipulate the Wasm WebIDL bindings custom section
Apache License 2.0
38 stars 9 forks source link

Add a convenience `on_parse` function #24

Closed alexcrichton closed 5 years ago

alexcrichton commented 5 years ago

Allows passing this function directly to walrus's on_parse callback without having to write it up yourself!

alexcrichton commented 5 years ago

if you had to parse multiple, you'd need to still define your own on_parse callback.

True!

I think you can still use the built-in method though:

ModuleConfig::new().on_parse(|module, ids| {
    // my stuf
    wasm_webidl_bindings::on_parse(module, ids)?;
    Ok(())
})

(vs having to write it all inline)

alexcrichton commented 5 years ago

Ah yes it's a lot nicer with remove_raw, not sure how I missed that earlier...