From 376a65423ab1ee70b536a9d9ecdca0d98696e32f Mon Sep 17 00:00:00 2001 From: Sam Tay Date: Fri, 30 Sep 2022 17:59:35 -0700 Subject: Remove unnecessary binding --- src/stackexchange/search.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/stackexchange/search.rs b/src/stackexchange/search.rs index 4a0abea..956a97d 100644 --- a/src/stackexchange/search.rs +++ b/src/stackexchange/search.rs @@ -124,10 +124,7 @@ impl Search { futures::stream::iter(question_ids) .map(|(site, ids)| { let api = self.api.clone(); - tokio::spawn(async move { - let api = &api; - api.questions(&site, ids).await - }) + tokio::spawn(async move { api.questions(&site, ids).await }) }) .buffer_unordered(CONCURRENT_REQUESTS_LIMIT) .collect::>() @@ -149,10 +146,7 @@ impl Search { let api = self.api.clone(); let limit = self.config.limit; let query = self.query.clone(); - tokio::spawn(async move { - let api = &api; - api.search_advanced(&query, &site, limit).await - }) + tokio::spawn(async move { api.search_advanced(&query, &site, limit).await }) }) .buffer_unordered(CONCURRENT_REQUESTS_LIMIT) .collect::>() -- cgit v1.2.3