Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add trie_rs::map::{Trie, TrieBuilder}. #20

Merged
merged 5 commits into from
Feb 10, 2024
Merged

Conversation

shanecelis
Copy link
Collaborator

Thank you for making this project and making it available. I added a key-value trie in the map module. I have seen others add this functionality with a whole sale reimplementation. This patch differs in that it doesn't change the original code; it really only adds a facade on top of the existing trie implementation in a separate module. It uses a private struct KeyValue<K,V>(K, V) pair where only the key is used for Eq and Ord.

In addition, I added a is_prefix() function. It's merely to avoid an allocation when all one wants is to know whether the given query is a prefix.

I added some docs to the public functions.

I did not bump any version numbers.

@laysakura laysakura merged commit 46e6a2f into laysakura:master Feb 10, 2024
@laysakura
Copy link
Owner

Thanks! Released in v0.2.0:
https://crates.io/crates/trie-rs

@shanecelis
Copy link
Collaborator Author

Thank you kindly for this very fast turnaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants