Earlier quoted context omitted.
> If we were to hypothesize a counterfactual world where webp was written in rust You don't have to hypothesize. It's here: https://github.com/image-rs/image/blob/master/src/codecs/web... and it doesn't use unsafe indexing.
That’s not google’s webp library, that’s a totally different project. It doesn’t really matter what that project does.
Meanwhile the real code that exists doesn’t work like that. It’s not just a matter of personal style. Rust has constructs that help avoid bounds checks. It has design patterns that move unsafe code into smaller, easier to verify helpers. It has a culture of caring about safety – people don’t rewrite projects in Rust to just give up on its biggest selling point.