the.bay.news

Wrapping a `HashSet` and implementing `Iterator`

The Rust Programming Language Forum
Wrapping a `HashSet` and implementing `Iterator`
Hey folks, I have the following struct: use std::collections::HashSet; use tantivy::tokenizer::{SimpleTokenizer, TokenStream, Tokenizer}; pub struct Vocabulary { #[allow(dead_code)] tokens: HashSet<String>, } impl Default for Vocabulary { fn default() -> Self { Self::new() } } impl Vocabulary { #[allow(dead_code)] pub fn new() -> Self { Self { tokens: HashSet::new() } } pub fn add_text(& mut self, text: &str) { let mut tokenizer = Sim...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.