Hacker News new | ask | show | jobs
by NitpickLawyer 138 days 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]) }) ```

1 comments

You'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