6 releases (2 stable)
1.1.0 | Oct 2, 2023 |
---|---|
1.0.0 | Aug 13, 2023 |
0.6.0 | Oct 13, 2022 |
0.4.0 | Mar 17, 2020 |
0.2.0 | Jun 17, 2018 |
#92 in #unicode-text
Used in unicode_names2
335KB
1K
SLoC
unicode_names2
Time and memory efficiently mapping characters to and from their Unicode 16.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.
lib.rs
:
A macro that maps unicode names to chars and strings.
Dependencies
~2.4–4MB
~75K SLoC