From b5002de9c4214272e0d0c0e24ed0e18c8e5e37e2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 29 Nov 2022 14:26:54 +1100 Subject: [PATCH] Return `Future + 'static` in `GhCrateMeta::launch_baseline_find_tasks` (#573) So that the borrow checker know that `FuturesUnordered` holds no reference to any data and thus it can further optimize future returned by `GhCrateMeta::find`. Signed-off-by: Jiahao XU --- crates/binstalk/src/fetchers/gh_crate_meta.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 257e2630..20c99e3a 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -40,7 +40,7 @@ impl GhCrateMeta { pkg_fmt: PkgFmt, pkg_url: &'a str, repo: Option<&'a str>, - ) -> impl Iterator + 'a> + 'a { + ) -> impl Iterator + 'static> + 'a { // build up list of potential URLs let urls = pkg_fmt.extensions().iter().filter_map(move |ext| { let ctx = Context::from_data_with_repo(&self.data, &self.target_data.target, ext, repo);