mlemesle / rustemon

A wrapper library for PokeApi, written in Rust
MIT License
27 stars 10 forks source link

change the cache location by specifying a path #11

Closed ghost closed 2 years ago

ghost commented 2 years ago

I'd like to be able to change the cache location using the new method of RustemonClient, a possible implementation of this would be :

pub fn new(cache_path: String, cache_mode: CacheMode, options: Option<CacheOption>) -> Self {
    Self {
        client: ClientBuilder::new(Client::new())
            .with(Cache(HttpCache {
                 mode: cache_mode,
                 manager: CACacheManager { path: cache_path },
                 options,
            }))
            .build(),
    }
}
mlemesle commented 2 years ago

Hey, thanks for using Rustemon and reaching out ! I reviewed your PR and left a comment, we can discuss about it if you want to

mlemesle commented 2 years ago

Sorry for the delayed answer ! Thanks for the idea and the PR. Thanks to you, version 2.1.0 will be released!

Congrats for your work and thanks again