From 987e667c3d2697579ca57cc8cf855aeca36b90b1 Mon Sep 17 00:00:00 2001 From: neon_arch Date: Mon, 17 Jul 2023 13:17:24 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20rename=20`results=5Fjson`?= =?UTF-8?q?=20to=20`results`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/routes.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/server/routes.rs b/src/server/routes.rs index e846fd9..cb6999d 100644 --- a/src/server/routes.rs +++ b/src/server/routes.rs @@ -129,13 +129,13 @@ async fn results( // check if fetched cache results was indeed fetched or it was an error and if so // handle the data accordingly. match cached_results_json { - Ok(results_json) => Ok(serde_json::from_str::(&results_json).unwrap()), + Ok(results) => Ok(serde_json::from_str::(&results).unwrap()), Err(_) => { // check if the cookie value is empty or not if it is empty then use the // default selected upstream search engines from the config file otherwise // parse the non-empty cookie and grab the user selected engines from the // UI and use that. - let mut results_json: crate::results::aggregation_models::SearchResults = match req + let mut results: crate::results::aggregation_models::SearchResults = match req .cookie("appCookie") { Some(cookie_value) => { @@ -160,9 +160,9 @@ async fn results( .await? } }; - results_json.add_style(config.style.clone()); - redis_cache.cache_results(serde_json::to_string(&results_json)?, &url)?; - Ok(results_json) + results.add_style(config.style.clone()); + redis_cache.cache_results(serde_json::to_string(&results)?, &url)?; + Ok(results) } } }