Closed sile closed 1 year ago
See #14 for the motivation.
// [CURRENT] Insert keys as bytes. let mut t = PatriciaMap::new(); t.insert("🌏🗻", ()); // [240,159,140,143,240,159,151,187] t.insert("🌏🍔", ()); // [240,159,140,143,240,159,141,148] let first_label = t.as_ref().child().unwrap().label(); assert!(std::str::from_utf8(first_label).is_err()); assert_eq!(first_label, [240, 159, 140, 143, 240, 159]); // [NEW] Insert keys as strings. let mut t = PatriciaMap::new(); t.insert_str("🌏🗻", ()); t.insert_str("🌏🍔", ()); let first_label = t.as_ref().child().unwrap().label(); assert_eq!(std::str::from_utf8(first_label).ok(), Some("🌏"));
I was looking for using this in a project, but need utf8 support. Is there a plan to update/merge this PR?
@vinaykakade Thank you for your comment. I'm going to merge this PR after some modifications.
See #14 for the motivation.
Examples