Closed LuckyTurtleDev closed 1 year ago
My issue was that if search only for .elpmaxe
inside the subtrei, but I looks like I need to include the prefix again, so I need to search for moc.elpmaxe
inside the subtrie, even when it is the subtrie from moc
.
Hi,
Can I check if the key of the root of a
SubTrie
is in inside The parentTrie
.For example I have insert the string
moc.elpmaxe
in aTrie<Vec<u8>,()>
Now I a stringmoc.elpmaxe.bus
. I now would like to check if at least one ofmoc
,moc.elpmaxe
ormoc.elpmaxe.bus
is inside the trie. So I have do something like this:Full source: https://github.com/LuckyTurtleDev/crab-hole/blob/82fb9af145f1bd5e7babf1b9b3f83a5837020a97/src/trie.rs#L21-L37
But this has not work. I am not sure if I had a bug in my implementation or if
subtrie.get(Vec::new())
can not check if the subtrie root is in. So I would like to validate first if callingsubtrie.get(Vec::new())
is the right procedure.