From 93d11aacd886ddedac176cd1b6fd92029d470a89 Mon Sep 17 00:00:00 2001 From: Sam Tay Date: Thu, 18 Jun 2020 14:59:01 -0700 Subject: For --lucky, only search first configured site --- src/stackexchange.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/stackexchange.rs b/src/stackexchange.rs index 77e8647..b6c6a16 100644 --- a/src/stackexchange.rs +++ b/src/stackexchange.rs @@ -91,9 +91,13 @@ impl StackExchange { } /// Search query at stack exchange and get the top answer body + /// + /// For now, use only the first configured site, since, parodoxically, sites + /// with the worst results will finish executing first, since there's less + /// data to retrieve. pub async fn search_lucky(&self) -> Result { Ok(self - .search_advanced(1) + .search_advanced_site(self.config.sites.iter().next().unwrap(), 1) .await? .into_iter() .next() -- cgit v1.2.3