neon_arch commited on
Commit
7d42c84
β€’
1 Parent(s): 72da323

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

Browse files
Files changed (1) hide show
  1. src/engines/startpage.rs +4 -11
src/engines/startpage.rs CHANGED
@@ -50,17 +50,10 @@ impl SearchEngine for Startpage {
50
  ) -> Result<HashMap<String, SearchResult>, EngineError> {
51
  // Page number can be missing or empty string and so appropriate handling is required
52
  // so that upstream server recieves valid page number.
53
- let url: String = match page {
54
- 1 | 0 => {
55
- format!("https://startpage.com/do/dsearch?q={query}&num=10&start=0")
56
- }
57
- _ => {
58
- format!(
59
- "https://startpage.com/do/dsearch?q={query}&num=10&start={}",
60
- page * 10,
61
- )
62
- }
63
- };
64
 
65
  // initializing HeaderMap and adding appropriate headers.
66
  let header_map = HeaderMap::try_from(&HashMap::from([
 
50
  ) -> Result<HashMap<String, SearchResult>, EngineError> {
51
  // Page number can be missing or empty string and so appropriate handling is required
52
  // so that upstream server recieves valid page number.
53
+ let url: String = format!(
54
+ "https://startpage.com/do/dsearch?q={query}&num=10&start={}",
55
+ page * 10,
56
+ );
 
 
 
 
 
 
 
57
 
58
  // initializing HeaderMap and adding appropriate headers.
59
  let header_map = HeaderMap::try_from(&HashMap::from([