Skip to content

.push() chokes on empty word? #45

@helixbass

Description

@helixbass

Hi, sorry I'm just posting this quickly as I ran into this, I can probably re-create/add more details if you want

I believe that I'm accidentally currently pushing an empty word (eg "") when using map::TrieBuilder to construct a map::Trie

And then it looks like that is causing a panic at this line: https://github.com/laysakura/trie-rs/blob/9fdacbb/src/internal_data_structure/naive_trie/naive_trie_impl.rs#L50

This is just a guess right now as I looked at the source code of that method since it is maybe currently assuming that it goes through the for loop at least once (and conceptually it I'm guessing makes no sense to try and push an empty word into a trie)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions