Return Future + 'static in GhCrateMeta::launch_baseline_find_tasks (#573)

So that the borrow checker know that `FuturesUnordered<F>` holds no
reference to any data and thus it can further optimize future returned
by `GhCrateMeta::find`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-11-29 14:26:54 +11:00 committed by GitHub
parent 30cc94b5bc
commit b5002de9c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,7 +40,7 @@ impl GhCrateMeta {
pkg_fmt: PkgFmt,
pkg_url: &'a str,
repo: Option<&'a str>,
) -> impl Iterator<Item = impl Future<Output = FindTaskRes> + 'a> + 'a {
) -> impl Iterator<Item = impl Future<Output = FindTaskRes> + '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);