neon_arch commited on
Commit
4460730
1 Parent(s): 975e8a4

chore: make clippy github action happy

Browse files
src/config_parser/parser.rs CHANGED
@@ -118,7 +118,7 @@ impl Config {
118
  {
119
  Ok("./websurfx/config.lua".to_string())
120
  } else {
121
- Err(format!("Config file not found!!").into())
122
  }
123
  }
124
  }
 
118
  {
119
  Ok("./websurfx/config.lua".to_string())
120
  } else {
121
+ Err("Config file not found!!".to_string().into())
122
  }
123
  }
124
  }
src/engines/duckduckgo.rs CHANGED
@@ -70,7 +70,7 @@ pub async fn results(
70
 
71
  let no_result: Selector = Selector::parse(".no-results")?;
72
 
73
- if let Some(_) = document.select(&no_result).next() {
74
  return Err(EngineErrorKind::EmptyResultSet);
75
  }
76
 
 
70
 
71
  let no_result: Selector = Selector::parse(".no-results")?;
72
 
73
+ if document.select(&no_result).next().is_some() {
74
  return Err(EngineErrorKind::EmptyResultSet);
75
  }
76
 
src/engines/engine_models.rs CHANGED
@@ -41,26 +41,20 @@ impl std::error::Error for EngineErrorKind {}
41
  /// Implementing `From` trait to map the `SelectorErrorKind` to `UnexpectedError` variant.
42
  impl<'a> From<SelectorErrorKind<'a>> for EngineErrorKind {
43
  fn from(err: SelectorErrorKind<'a>) -> Self {
44
- match err {
45
- _ => Self::UnexpectedError(err.to_string()),
46
- }
47
  }
48
  }
49
 
50
  /// Implementing `From` trait to map the `InvalidHeaderValue` to `UnexpectedError` variant.
51
- impl<'a> From<InvalidHeaderValue> for EngineErrorKind {
52
  fn from(err: InvalidHeaderValue) -> Self {
53
- match err {
54
- _ => Self::UnexpectedError(err.to_string()),
55
- }
56
  }
57
  }
58
 
59
  /// Implementing `From` trait to map all `reqwest::Error` to `UnexpectedError` variant.
60
- impl<'a> From<reqwest::Error> for EngineErrorKind {
61
  fn from(err: reqwest::Error) -> Self {
62
- match err {
63
- _ => Self::RequestError(err),
64
- }
65
  }
66
  }
 
41
  /// Implementing `From` trait to map the `SelectorErrorKind` to `UnexpectedError` variant.
42
  impl<'a> From<SelectorErrorKind<'a>> for EngineErrorKind {
43
  fn from(err: SelectorErrorKind<'a>) -> Self {
44
+ Self::UnexpectedError(err.to_string())
 
 
45
  }
46
  }
47
 
48
  /// Implementing `From` trait to map the `InvalidHeaderValue` to `UnexpectedError` variant.
49
+ impl From<InvalidHeaderValue> for EngineErrorKind {
50
  fn from(err: InvalidHeaderValue) -> Self {
51
+ Self::UnexpectedError(err.to_string())
 
 
52
  }
53
  }
54
 
55
  /// Implementing `From` trait to map all `reqwest::Error` to `UnexpectedError` variant.
56
+ impl From<reqwest::Error> for EngineErrorKind {
57
  fn from(err: reqwest::Error) -> Self {
58
+ Self::RequestError(err)
 
 
59
  }
60
  }