| Crates.io | easy-trie |
| lib.rs | easy-trie |
| version | 0.1.4 |
| created_at | 2025-02-24 13:44:30.809311+00 |
| updated_at | 2025-02-25 11:02:01.60446+00 |
| description | A simple trie implementation in Rust |
| homepage | |
| repository | https://github.com/macmist/rust-trie |
| max_upload_size | |
| id | 1567478 |
| size | 22,418 |
This is a simple rust trie library. Essentially, I wanted to understand how to create and publish a crate so I was looking for something simple but useful.
cargo add easy-trie
use easy_trie::trie::Trie;
let mut trie = Trie::new();
trie.insert("hello");
assert_eq!(trie.len(), 5);
assert!(trie.contains("hello"));
assert!(!trie.contains("world"));
use easy_trie::trie::Trie;
let mut trie = Trie::new();
trie.insert("hello");
trie.insert("help");
let suggestions = trie.suggest("h");
assert!(suggestions.contains(&"hello".to_string()));
assert!(suggestions.contains(&"help".to_string()));