refactor: replace CStr::from_ptr(ptr).to_str() with from_utf8_unchecked#66
Conversation
Codecov Report
@@ Coverage Diff @@
## master #66 +/- ##
==========================================
- Coverage 72.09% 72.09% -0.01%
==========================================
Files 109 109
Lines 7279 7278 -1
==========================================
- Hits 5248 5247 -1
Misses 2031 2031
Continue to review full report at Codecov.
|
Wodann
left a comment
There was a problem hiding this comment.
Thank you for you PR. Good find to reuse the CStr::from_ptr function to convert a null-terminated C-style string into a u8 slice 👍
I added one request for change, as we only need to replace the UTF-8 validation in the ABI. If you could revert the changes to crates/mun_runtime_capi/src/lib.rs that'd be great :)
There is one other thing that needs to happen before we can merge this PR. Issue #53 depends on issue #52. That issue adds unit tests to validate that our compiler always generates valid UTF-8 strings. Once that issue has been closed, we can guarantee that there will not be any runtime regressions. If you have time, would you be interested in having a look at issue #52 as well? It will introduce you to an important development aspect of Mun; namely regression testing.
|
Thank you for the improvements. It all looks good now. I'll still hold on merging until issue #52 has been resolved. |
closes #53