mirror of
https://github.com/astral-sh/ruff.git
synced 2026-10-28 10:45:37 +08:00
Co-authored-by: astral-automations-bot[bot] <305554984+astral-automations-bot[bot]@users.noreply.github.com> Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
unicode_names2
Time and memory efficiently mapping characters to and from their Unicode 17.0 names, at runtime and compile-time.
fn main() {
println!("☃ is called {}", unicode_names2::name('☃')); // SNOWMAN
println!("{} is happy", unicode_names2::character("white smiling face")); // ☺
// (NB. case insensitivity)
}
The maps are compressed using similar tricks to Python's unicodedata
module, although those here are about 70KB (12%) smaller.
