Closed dbrgn closed 2 years ago
I wonder why they don't have a make_lowercase
🤔 I agree, the one allocation doesn't matter. However, I think it would be nice to have the code that handles these what-users-enter-vs-what-files-we-are-looking-for logic in one place. Maybe this change here is better fit right after the code where the words are joined with '-'
? What do you think?
I wonder why they don't have a
make_lowercase
🤔
You mean in-place? That won't work, because it might be possible that the lowercased string requires more bytes than the uppercased string (depending on some unicode edge cases). It's not all ASCII 🙂
Maybe this change here is better fit right after the code where the words are joined with
'-'
? What do you think?
Yeah, that would actually make sense, then the user sees the real page name that was used for the lookup in the error message (if the page wasn't found).
This adds another allocation that wasn't necessary before, but the overhead is totally negligible.
Part of #209.