From 2bdddaf928e495cb965a30d8182ebe780313b916 Mon Sep 17 00:00:00 2001 From: neon_arch Date: Sat, 30 Dec 2023 13:06:35 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=EF=B8=8F=20fix(engine):=20fix=20th?= =?UTF-8?q?e=20pagination=20code=20for=20`librex`=20engine=20(#468)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/engines/librex.rs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/engines/librex.rs b/src/engines/librex.rs index 933c7f2..b34393f 100644 --- a/src/engines/librex.rs +++ b/src/engines/librex.rs @@ -65,17 +65,10 @@ impl SearchEngine for LibreX { ) -> Result, EngineError> { // Page number can be missing or empty string and so appropriate handling is required // so that upstream server recieves valid page number. - let url: String = match page { - 1 | 0 => { - format!("https://search.ahwx.org/search.php?q={query}&p=0&t=10") - } - _ => { - format!( - "https://search.ahwx.org/search.php?q={query}&p={}&t=10", - page * 10, - ) - } - }; + let url: String = format!( + "https://search.ahwx.org/search.php?q={query}&p={}&t=10", + page * 10 + ); // initializing HeaderMap and adding appropriate headers. let header_map = HeaderMap::try_from(&HashMap::from([