mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-01-18 21:34:48 +01:00
feffaf8bbc
Returning a reference from a trait method is relatively difficult to map in bindings and is currently handled by storing the object in the trait instance, returning a reference to the local field. This is fine when the object we're returning only needs to live as long as the trait, but when it needs to be `'static` (as is the case for onion message `msg_type`s), there's not really a good way to map them at all. Instead, here, condition on `#[cfg(c_bindings)]` we return a fully owned `String`. This is obviously relatively less effecient, but the extra allocation and `memcpy` isn't the end of the world, especially given it should be released relatively quickly. Note that this breaks doctests in with `c_bindings`. |
||
---|---|---|
.. | ||
check-compiles.sh | ||
check-each-commit.sh | ||
ci-tests.sh | ||
rustfmt.sh |