compenguy / ngrammatic

A rust crate providing fuzzy search/string matching using N-grams
MIT License
25 stars 7 forks source link

Add `Send` and `Sync` bounds to `key_trans` in `Corpus` #1

Closed roccodev closed 4 years ago

roccodev commented 4 years ago

Since key_trans is Fn, in the majority of use cases it'll be Send + Sync.

Adding these bounds marks Corpus as thread-safe, allowing shared concurrent access (there's no interior mutability in Corpus or any of its fields AFAIK) and sending the struct between threads.

compenguy commented 4 years ago

Thanks. Published as 0.3.2.