Guest User

Untitled

a guest
May 24th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. pub fn insert(trie: Trie, string: &str) -> Trie {
  2. match trie {
  3. Trie::Leaf => Trie::Node(vec![(string.to_owned(), Trie::Leaf)]),
  4. Trie::Node(mut children) => {
  5. if let Some((_label, _edge)) = search_prefix(&children, string) {
  6. return unimplemented!();
  7. }
  8. children.push((string.to_owned(), Trie::Leaf));
  9. Trie::Node(children)
  10. }
  11. }
  12. }
Add Comment
Please, Sign In to add comment