]> 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>
Fri, 15 Jan 2021 01:25:08 +0000 (20:25 -0500)
commitdee5fa89ac16a5ed8a6f1df9cb33e598b70731ac
tree853440afcd526ecf632bd77d3cf59e81837e00fe
parent30bf801696ed9305c20510f2983a66bec7a6b1ed
[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