3 ms·
My new favorite claudism: > 100% Safe Rust No unsafe blocks. And then when you search the code... ``` // SAFETY: We only store valid UTF-8 in the grapheme byt
by NitpickLawyer 9mo ago
My new favorite claudism: > 100% Safe Rust No unsafe blocks.
And then when you search the code...
```
// SAFETY: We only store valid UTF-8 in the grapheme bytes
Some(unsafe {
std::str::from_utf8_unchecked(&self.grapheme[..self.grapheme_len as usize])
})
```
- ccheshirecat 9mo agoYou're absolutely right! I've - Replaced unsafe from_utf8_unchecked with safe from_utf8 - Added #![deny(unsafe_code)] at crate level - FFI module still allows unsafe (required for C ABI) - README now honestly says 'Safe Rust Core' instead of '100% Safe Rust' Thanks to NitpickLawyer on HN for the callout