diff --git a/src/config_parser/parser.rs b/src/config_parser/parser.rs index ac200cd..4c5c1e6 100644 --- a/src/config_parser/parser.rs +++ b/src/config_parser/parser.rs @@ -118,7 +118,7 @@ impl Config { { Ok("./websurfx/config.lua".to_string()) } else { - Err(format!("Config file not found!!").into()) + Err("Config file not found!!".to_string().into()) } } } diff --git a/src/engines/duckduckgo.rs b/src/engines/duckduckgo.rs index 219801a..64c34c3 100644 --- a/src/engines/duckduckgo.rs +++ b/src/engines/duckduckgo.rs @@ -70,7 +70,7 @@ pub async fn results( let no_result: Selector = Selector::parse(".no-results")?; - if let Some(_) = document.select(&no_result).next() { + if document.select(&no_result).next().is_some() { return Err(EngineErrorKind::EmptyResultSet); } diff --git a/src/engines/engine_models.rs b/src/engines/engine_models.rs index 16cc266..3d0a30d 100644 --- a/src/engines/engine_models.rs +++ b/src/engines/engine_models.rs @@ -41,26 +41,20 @@ impl std::error::Error for EngineErrorKind {} /// Implementing `From` trait to map the `SelectorErrorKind` to `UnexpectedError` variant. impl<'a> From> for EngineErrorKind { fn from(err: SelectorErrorKind<'a>) -> Self { - match err { - _ => Self::UnexpectedError(err.to_string()), - } + Self::UnexpectedError(err.to_string()) } } /// Implementing `From` trait to map the `InvalidHeaderValue` to `UnexpectedError` variant. -impl<'a> From for EngineErrorKind { +impl From for EngineErrorKind { fn from(err: InvalidHeaderValue) -> Self { - match err { - _ => Self::UnexpectedError(err.to_string()), - } + Self::UnexpectedError(err.to_string()) } } /// Implementing `From` trait to map all `reqwest::Error` to `UnexpectedError` variant. -impl<'a> From for EngineErrorKind { +impl From for EngineErrorKind { fn from(err: reqwest::Error) -> Self { - match err { - _ => Self::RequestError(err), - } + Self::RequestError(err) } }