From a56db54b72d2a4dfd3e3180032ae5ed9ca66e86d Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Tue, 12 Feb 2019 16:24:48 +0100 Subject: [PATCH] Generate cache and save it on first run --- src/pgd.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pgd.rs b/src/pgd.rs index 41f10fe..4838a9e 100644 --- a/src/pgd.rs +++ b/src/pgd.rs @@ -18,7 +18,11 @@ fn main_with_cache(request: &str, regen: bool) -> Result<()> { let (cache, just_generated) = match Cache::read() { Ok(c) => (c, false), - Err(_) => (Cache::generate(), true), + Err(_) => { + let cache = Cache::generate(); + cache.write()?; + (cache, true) + }, }; let only_match = match cache.find_interactive(&request) {