# Simple Trie

[](https://crates.io/crates/easy-trie)
[](https://github.com/macmist/rust-trie/blob/main/LICENSE)
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.
## Installation
`cargo add easy-trie`
## Examples
### Simple case
```rust
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"));
```
### Suggestions
```rust
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()));
```