mirror of
https://github.com/neon-mmd/websurfx.git
synced 2024-11-21 13:38:21 -05:00
chore: make clippy github action happy
This commit is contained in:
parent
975e8a480b
commit
4460730ca6
@ -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())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -41,26 +41,20 @@ impl std::error::Error for EngineErrorKind {}
|
||||
/// Implementing `From` trait to map the `SelectorErrorKind` to `UnexpectedError` variant.
|
||||
impl<'a> From<SelectorErrorKind<'a>> 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<InvalidHeaderValue> for EngineErrorKind {
|
||||
impl From<InvalidHeaderValue> 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<reqwest::Error> for EngineErrorKind {
|
||||
impl From<reqwest::Error> for EngineErrorKind {
|
||||
fn from(err: reqwest::Error) -> Self {
|
||||
match err {
|
||||
_ => Self::RequestError(err),
|
||||
}
|
||||
Self::RequestError(err)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user