eagleflo / jisho

Jisho is a CLI tool & Rust library that provides a Japanese-English dictionary.
GNU General Public License v3.0
13 stars 1 forks source link

Using lazy_static macro #4

Closed eagleflo closed 3 years ago

eagleflo commented 3 years ago

Currently dictionary initialization happens on each lookup. That's not ideal. Unfortunately static variables come with a lot of restrictions in Rust; heap allocation being forbidden for one.

It looks like https://docs.rs/lazy_static/1.4.0/lazy_static/ might offer a way to sidestep that issue.