Function base_emoji::to_custom
[−]
[src]
pub fn to_custom<T: AsRef<[u8]>, F: Fn(&str, &str) -> String>(
buf: T,
f: F
) -> String
Encode buffer as custom-mapped string
let input = [0xde]; let output = "<img src='/img/snowflake.png' alt='βοΈ' title='snowflake'>"; assert_eq!( base_emoji::to_custom(&input, |ch, name| { format!("<img src='/img/{}.png' alt='{}' title='{}'>", name, ch, name) }), output);