Quick Review of `uncased` Crate

Maybe it's a little odd asking for a review on somebody else's crate, but I'm wanting to use the uncased crate for supporting ASCII case-insensitivity, but it's relatively new and has just a few uses of unsafe code that looks well justified and sound to me, but I'm not super qualified to judge soundness so I wanted to get another pair of eyes on it real quick. It's rather short and should be easy to review:

Thanks!

In a brief review I did not find any issues with the code, and am generally satisfied with the handful of unsafe blocks. I did find one confusing comment that appears to be out-of-date: Update comment about repr(C) by mbrubeck · Pull Request #1 · SergioBenitez/uncased · GitHub

2 Likes

Awesome, thanks! :+1:

The unsafe code looks sound. The only thing I noticed is that the indexing in starts_with may unexpectedly panic when working with non-ascii strings:

3 Likes

Good catch!