neon_arch commited on
Commit
2bdddaf
β€’
1 Parent(s): 0dd25aa

πŸš‘οΈ fix(engine): fix the pagination code for `librex` engine (#468)

Browse files
Files changed (1) hide show
  1. src/engines/librex.rs +4 -11
src/engines/librex.rs CHANGED
@@ -65,17 +65,10 @@ impl SearchEngine for LibreX {
65
  ) -> Result<HashMap<String, SearchResult>, EngineError> {
66
  // Page number can be missing or empty string and so appropriate handling is required
67
  // so that upstream server recieves valid page number.
68
- let url: String = match page {
69
- 1 | 0 => {
70
- format!("https://search.ahwx.org/search.php?q={query}&p=0&t=10")
71
- }
72
- _ => {
73
- format!(
74
- "https://search.ahwx.org/search.php?q={query}&p={}&t=10",
75
- page * 10,
76
- )
77
- }
78
- };
79
 
80
  // initializing HeaderMap and adding appropriate headers.
81
  let header_map = HeaderMap::try_from(&HashMap::from([
 
65
  ) -> Result<HashMap<String, SearchResult>, EngineError> {
66
  // Page number can be missing or empty string and so appropriate handling is required
67
  // so that upstream server recieves valid page number.
68
+ let url: String = format!(
69
+ "https://search.ahwx.org/search.php?q={query}&p={}&t=10",
70
+ page * 10
71
+ );
 
 
 
 
 
 
 
72
 
73
  // initializing HeaderMap and adding appropriate headers.
74
  let header_map = HeaderMap::try_from(&HashMap::from([