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