0
0
mirror of https://github.com/neon-mmd/websurfx.git synced 2024-11-22 05:58:21 -05:00

chore: make clippy github action happy

This commit is contained in:
neon_arch 2023-06-01 12:21:45 +03:00
parent 975e8a480b
commit 4460730ca6
3 changed files with 7 additions and 13 deletions

View File

@ -118,7 +118,7 @@ impl Config {
{ {
Ok("./websurfx/config.lua".to_string()) Ok("./websurfx/config.lua".to_string())
} else { } else {
Err(format!("Config file not found!!").into()) Err("Config file not found!!".to_string().into())
} }
} }
} }

View File

@ -70,7 +70,7 @@ pub async fn results(
let no_result: Selector = Selector::parse(".no-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); return Err(EngineErrorKind::EmptyResultSet);
} }

View File

@ -41,26 +41,20 @@ impl std::error::Error for EngineErrorKind {}
/// Implementing `From` trait to map the `SelectorErrorKind` to `UnexpectedError` variant. /// Implementing `From` trait to map the `SelectorErrorKind` to `UnexpectedError` variant.
impl<'a> From<SelectorErrorKind<'a>> for EngineErrorKind { impl<'a> From<SelectorErrorKind<'a>> for EngineErrorKind {
fn from(err: SelectorErrorKind<'a>) -> Self { 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. /// Implementing `From` trait to map the `InvalidHeaderValue` to `UnexpectedError` variant.
impl<'a> From<InvalidHeaderValue> for EngineErrorKind { impl From<InvalidHeaderValue> for EngineErrorKind {
fn from(err: InvalidHeaderValue) -> Self { 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. /// Implementing `From` trait to map all `reqwest::Error` to `UnexpectedError` variant.
impl<'a> From<reqwest::Error> for EngineErrorKind { impl From<reqwest::Error> for EngineErrorKind {
fn from(err: reqwest::Error) -> Self { fn from(err: reqwest::Error) -> Self {
match err { Self::RequestError(err)
_ => Self::RequestError(err),
}
} }
} }