From 1a222217c45db5e1248f6808bf04ba060bc7f06e Mon Sep 17 00:00:00 2001 From: neon_arch Date: Tue, 12 Sep 2023 17:59:33 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20chore:=20make=20github=20actions?= =?UTF-8?q?=20happy=20(#205)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cache/error.rs | 9 +++------ src/results/aggregation_models.rs | 13 ++++++------- src/server/routes.rs | 3 ++- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/cache/error.rs b/src/cache/error.rs index efd87c9..8bdb977 100644 --- a/src/cache/error.rs +++ b/src/cache/error.rs @@ -5,15 +5,12 @@ use std::fmt; use redis::RedisError; /// A custom error type used for handling redis async pool associated errors. -/// -/// This enum provides variants three different categories of errors: -/// * `RedisError` - This variant handles all errors related to `RedisError`, -/// * `PoolExhaustionWithConnectionDropError` - This variant handles the error -/// which occurs when all the connections in the connection pool return a connection -/// dropped redis error. #[derive(Debug)] pub enum PoolError { + /// This variant handles all errors related to `RedisError`, RedisError(RedisError), + /// This variant handles the errors which occurs when all the connections + /// in the connection pool return a connection dropped redis error. PoolExhaustionWithConnectionDropError, } diff --git a/src/results/aggregation_models.rs b/src/results/aggregation_models.rs index 495572a..30316e2 100644 --- a/src/results/aggregation_models.rs +++ b/src/results/aggregation_models.rs @@ -114,12 +114,12 @@ pub struct SearchResults { /// Stores the information on which engines failed with their engine name /// and the type of error that caused it. pub engine_errors_info: Vec, - /// Stores the flag option which holds the check value that the following - /// search query was disallowed when the safe search level set to 4 and it + /// Stores the flag option which holds the check value that the following + /// search query was disallowed when the safe search level set to 4 and it /// was present in the `Blocklist` file. pub disallowed: bool, - /// Stores the flag option which holds the check value that the following - /// search query was filtered when the safe search level set to 3 and it + /// Stores the flag option which holds the check value that the following + /// search query was filtered when the safe search level set to 3 and it /// was present in the `Blocklist` file. pub filtered: bool, } @@ -133,9 +133,8 @@ impl SearchResults { /// and stores it into a vector of `SearchResult` structs. /// * `page_query` - Takes an argument of current page`s search query `q` provided in /// the search url. - /// * `empty_result_set` - Takes a boolean which indicates that no engines gave a result for the - /// given search query. - /// * `` + /// * `engine_errors_info` - Takes an array of structs which contains information regarding + /// which engines failed with their names, reason and their severity color name. pub fn new( results: Vec, page_query: &str, diff --git a/src/server/routes.rs b/src/server/routes.rs index 96ad737..29b36aa 100644 --- a/src/server/routes.rs +++ b/src/server/routes.rs @@ -230,7 +230,8 @@ async fn results( // UI and use that. let mut results: SearchResults = match req.cookie("appCookie") { Some(cookie_value) => { - let cookie_value: Cookie = serde_json::from_str(cookie_value.name_value().1)?; + let cookie_value: Cookie<'_> = + serde_json::from_str(cookie_value.name_value().1)?; let engines: Vec = cookie_value .engines