You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@dfordivam No, nowadays you can work with &str or String at application level and Rust SDK will convert them seamlessly into a C compatible string with CString::new. Avoiding additional heap allocation as you propose is thus counter balanced with less comfort at application level, as it implies adding systematically '\0' at the end of every string to be passed to NBGL object to be displayed.
It may be possible to avoid additional allocation of the fields on heap by making use of APIs like core::ffi::CStr from_bytes_until_nul
ledger-device-rust-sdk/ledger_device_sdk/src/nbgl.rs
Lines 328 to 334 in 3c22c1c
Also the
unwrap
may be avoided on user provided fields, and return an error instead.The text was updated successfully, but these errors were encountered: