penmanship 0.1.0

A Unicode character lookup library for converting text patterns to Unicode characters
Documentation
//! Currency symbol mappings.

use phf::phf_map;

/// Currency symbol mappings.
///
/// Common international currency symbols.
pub static CURRENCY: phf::Map<&'static str, (&'static str, &'static str)> = phf_map! {
    "euro" => ("\u{20AC}", "euro sign"),       //    "pound" => ("\u{00A3}", "pound sign"),     // £
    "yen" => ("\u{00A5}", "yen sign"),         // ¥
    "cent" => ("\u{00A2}", "cent sign"),       // ¢
    "rupee" => ("\u{20B9}", "rupee sign"),     //    "won" => ("\u{20A9}", "won sign"),         //    "bitcoin" => ("\u{20BF}", "bitcoin sign"), //    "btc" => ("\u{20BF}", "bitcoin sign"),     //};

#[cfg(test)]
mod tests {
    use super::*;

    /// Test currency symbol lookups.
    #[test]
    fn test_currency_symbols() {
        assert_eq!(CURRENCY.get("euro"), Some(&("\u{20AC}", "euro sign")));
        assert_eq!(CURRENCY.get("pound"), Some(&("\u{00A3}", "pound sign")));
        assert_eq!(CURRENCY.get("yen"), Some(&("\u{00A5}", "yen sign")));
        assert_eq!(CURRENCY.get("cent"), Some(&("\u{00A2}", "cent sign")));
    }
}