There was a bug whereby removing a key that had not been inserted into the trie would cause a panic! because its value wasn't checked in recursive_remove before calling rec_remove. The length was checked instead, but in hindsight, that's obviously insufficient.
The solution was to copy (!) more of the key-checking logic from rec_remove into the top-level recursive_remove. The logic to merge the parent with its only child is not required in the top-level, because the root node should always retain its [] key.
There was a bug whereby removing a key that had not been inserted into the trie would cause a
panic!
because its value wasn't checked inrecursive_remove
before callingrec_remove
. The length was checked instead, but in hindsight, that's obviously insufficient.The solution was to copy (!) more of the key-checking logic from
rec_remove
into the top-levelrecursive_remove
. The logic to merge the parent with its only child is not required in the top-level, because the root node should always retain its[]
key.Closes #40