the.bay.news

Reducing duplication in `TryFrom`

The Rust Programming Language Forum
Reducing duplication in `TryFrom`
Hey folks, I've got the following duplication: impl TryFrom<Reader<&[u8]>> for DictionaryStemmer { type Error = Error; fn try_from(mut reader: Reader<&[u8]>) -> Result<Self, Self::Error> { let mut term_stems: HashMap<String, String> = HashMap::new(); for record in reader.deserialize() { let term_stem: TermStem = record?; if let Some(stem) = term_stem.dpd_stem { term_stems.insert(term_stem.term, stem); } } ...

0 comments

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

No comments yet.