]> git.bitcoin.ninja Git - rust-lightning/commit
[bindings] Concretize Result types without type aliasing
authorMatt Corallo <git@bluematt.me>
Mon, 4 Jan 2021 22:29:25 +0000 (17:29 -0500)
committerMatt Corallo <git@bluematt.me>
Tue, 5 Jan 2021 00:30:22 +0000 (19:30 -0500)
commit008635f02c87728f8dc7f64daf4dcd8ababfb31e
tree83abc4890ec78e9ed532d7caf6c63abf8970f839
parentbe069d6f8ddfd357daa496525d350906a280fd92
[bindings] Concretize Result types without type aliasing

While the type aliasing trick works great for cbindgen,
wasm_bindgen doesn't support it and requires fully-concrete types.
In order to better support wasm_bindgen in the future, we do so
here, adding a function which manually writes out almost the exact
thing which was templated previously in concrete form.

As a nice side-effect, we no longer have to allocate and free a u8
for generic parameters which were `()` (though we still do in some
conversion functions, which we can get rid of when we similarly
concretize all generics fully).
c-bindings-gen/src/blocks.rs
c-bindings-gen/src/types.rs
lightning-c-bindings/src/c_types/mod.rs