mirror of
https://github.com/rust-lang/rust.git
synced 2026-07-28 02:22:18 -04:00
af4cac9fd5
str: add ASCII fast path to word_to_titlecase The word_to_titlecase function had a FIXME comment since a long time asking to add a fast path for ASCII text. Before this change, even simple English text like "hello world" was going through slow Unicode lookup tables. That was unnecessary. This fixes it by using the same trick that to_lowercase already uses — plain English letters are now handled much faster, and only Greek/Chinese/etc still use the Unicode tables. No behavior changes, just faster for normal English text.