Closed tommilligan closed 4 years ago
Thanks for the contribution! We haven't pushed this package yet as it's missing quite a lot of things before being useful for anybody. I will check the changes when I get back on computer
Clippy appears to be failing with some existing master issues
@all-contributors please add @tommilligan for Code
@drodil
I've put up a pull request to add @tommilligan! :tada:
Closes #43
Implements the
beer_styles
data as a JSON data file, rather than native rust structs.This data is inlined at compile time using the
include_str!
macro, and deserialised the first timeBEER_STYLES
is dereferenced (usingonce_cell
).The additional refactoring of
commands/beer_style.rs
is due to the fact thatBeerStyle
is no longerCopy
as it contains aString
. The way results are calculated now results in less data copying overall, so I think it's a win still.Yep, external users can still use the data as before by
use rustybeer::utils::beer_styles::BEER_STYLES;
. The type has changed toVec<BeerStyle>
though. If you'd already published0.1.0
that would make this a breaking change.