rushmorem / publicsuffix

An implementation of Mozilla's Public Suffix List in Rust
MIT License
97 stars 17 forks source link

Static lists #14

Closed jprider63 closed 6 years ago

jprider63 commented 6 years ago

I'd like to create Lists statically at compile-time (I don't want to rely on the internet or ship the dat file). I've implemented this here using lazy_static! and include_str!. Currently, this should extract the &str at compile-time and lazily build the list at run-time. Would you be interested in including this static list in this crate?

I just created the pull request #13, which adds a function from_str to create a List. This should eliminate the need to call to_string which might save some memory.

rushmorem commented 6 years ago

Thank you. I've just released v1.5.0, which includes your pull request.

Would you be interested in including this static list in this crate?

Since the Public Suffix List is a living document, I prefer that caching strategies, like the psl crate, be maintained externally.

jprider63 commented 6 years ago

Ok no worries. I'll release staticpublicsuffix as a separate library in case anyone else needs this functionality.

rushmorem commented 6 years ago

Cool, thanks.

rushmorem commented 6 years ago

@jprider63 You may be interested in the newer replacement of this crate which is a lot faster. See some benchmarks against a C library, libpsl and a PyPy one, publicsuffix.