unicode_names2 2.0.0

Map characters to and from their name given in the Unicode standard. This goes to great lengths to be as efficient as possible in both time and space, with the full bidirectional tables weighing barely 500 KB but still offering O(1)* look-up in both directions. (*more precisely, O(length of name).)
Documentation
use std::char;

// Count how many code points have names in the standard.
//
// This does a full naive scan of all valid codepoints, and still only
// takes milliseconds to complete. Specifically, with optimisations,
// it takes about 14ms to run, meaning ~12ns per look-up (only 2048
// out of 1114111 fail the from_u32 check).
//
// NB. this is not actually doing any work to compute the name, just
// checking it exists, which is why it can be so efficient.

fn main() {
    let number = (0u32..0x10FFFF)
        .filter(|x| char::from_u32(*x).map_or(false, |c| unicode_names2::name(c).is_some()))
        .count();

    println!("there are {} named code points", number)
}