3 ms·
Use a CxxString: https://cxx.rs/binding/cxxstring.html https://cxx.rs/binding/cxxstring.html At some point there will need to be an allocation when crossing Ru
by imron 4y ago
Use a CxxString: https://cxx.rs/binding/cxxstring.html https://cxx.rs/binding/cxxstring.html
At some point there will need to be an allocation when crossing Rust -> C++ boundary because Rust strings are not null-terminated.
The difference Rust makes is that unlike C++, it is always explicit when the allocation occurs.
- IshKebab 4y agoUnfortunately the restrictions mentioned on that page make it quite a pain to use in practice.