]> git.bitcoin.ninja Git - ldk-c-bindings/commit
Fix handling of returning Option<&Object> from Rust functions
authorMatt Corallo <git@bluematt.me>
Mon, 3 May 2021 17:52:43 +0000 (17:52 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 3 May 2021 17:55:40 +0000 (17:55 +0000)
commit0674d16ca0aec6b5718391bd78c25567640c3bf8
tree24d71af9a6f5566140f73e1fc3c30dd3c8cbfb74
parentd3d51441b4cd98389308d4cfaba6548f25598c4c
Fix handling of returning Option<&Object> from Rust functions

Specifically, these were previously mapped by calling
`<object.as_ref().unwrap() as *const _>`, taking a pointer to the
option on stack instead of a pointer to the option itself.

We just need to drop the `as_ref()` to make it correct.
c-bindings-gen/src/types.rs