Closed dwrensha closed 9 years ago
extern crate radix_trie; use radix_trie::Trie; fn main() { let mut trie = Trie::new(); trie.insert("a", ()); trie.insert("p", ()); trie.remove(&"a"); assert_eq!(trie.len(), 1); }
thread '<main>' panicked at 'assertion failed: `(left == right)` (left: `0`, right: `1`)',
I think this occurs whenever the root node goes from having 2 children to having only 1 child. Trie::delete_node() tries to replace the root node with its only child, but Trie::remove() ignores the DeleteAction that would make this work.
Trie::delete_node()
Trie::remove()
DeleteAction
Yay, thanks for fixing!
I think this occurs whenever the root node goes from having 2 children to having only 1 child.
Trie::delete_node()
tries to replace the root node with its only child, butTrie::remove()
ignores theDeleteAction
that would make this work.