Repository: denoland/deno
File: cli/tools/registry/pm/deps.rs (Rust)

Code before:
    let mut futs = FuturesOrdered::new();

    for dep in &self.deps {
      match dep.kind {
        DepKind::Npm => futs.push_back(
          async {
            let semver_req = &dep.req;
            let _permit = npm_sema.acquire().await;
            let semver_compatible =
              self.npm_fetch_resolver.req_to_nv(semver_req).await;
            let info =
              self.npm_fetch_resolver.package_info(&semver_req.name).await;
            let latest = info
              .and_then(|info| {
                let latest_tag = info.dist_tags.get("latest")?;
                let lower_bound =
                  semver_compatible.as_ref().map(|nv| &nv.version)?;
                if latest_tag > lower_bound {
                  Some(latest_tag.clone())
                } else {
                  latest_version(Some(latest_tag), info.versions.keys())
                }
              })
              .map(|version| PackageNv {
                name: semver_req.name.clone(),
                version: version.clone(),
              });
            PackageLatestVersion {
              latest,
              semver_compatible,
            }
          }
          .boxed_local(),
        ),
        DepKind::Jsr => futs.push_back(
          async {
            let semver_req = &dep.req;
            let _permit = jsr_sema.acquire().await;
            let semver_compatible =
              self.jsr_fetch_resolver.req_to_nv(semver_req).await;
            let info =
              self.jsr_fetch_resolver.package_info(&semver_req.name).await;
            let lower_bound = semver_compatible.as_ref().map(|nv| &nv.version);
            let latest = info
              .and_then(|info| {
                latest_version(
                  lower_bound,
                  info.versions.iter().filter_map(|(version, version_info)| {
                    if !version_info.yanked {
                      Some(version)
                    } else {

Review comment (suggestion):
```suggestion
                version,
```

I think.

Code after:
            let _permit = npm_sema.acquire().await;
            let semver_compatible =
              self.npm_fetch_resolver.req_to_nv(semver_req).await;
            let info =
              self.npm_fetch_resolver.package_info(&semver_req.name).await;
            let latest = info
              .and_then(|info| {
                let latest_tag = info.dist_tags.get("latest")?;
                let lower_bound = &semver_compatible.as_ref()?.version;
                if latest_tag > lower_bound {
                  Some(latest_tag.clone())
                } else {
                  latest_version(Some(latest_tag), info.versions.keys())
                }
              })
              .map(|version| PackageNv {
                name: semver_req.name.clone(),
                version,
              });
            PackageLatestVersion {
              latest,
              semver_compatible,
            }
          }
          .boxed_local(),
        ),
        DepKind::Jsr => futs.push_back(
          async {
            let semver_req = &dep.req;
            let _permit = jsr_sema.acquire().await;
            let semver_compatible =
              self.jsr_fetch_resolver.req_to_nv(semver_req).await;
            let info =
              self.jsr_fetch_resolver.package_info(&semver_req.name).await;
            let latest = info
              .and_then(|info| {
                let lower_bound = &semver_compatible.as_ref()?.version;
                latest_version(
                  Some(lower_bound),
                  info.versions.iter().filter_map(|(version, version_info)| {
                    if !version_info.yanked {
                      Some(version)
                    } else {
                      None
                    }
                  }),
                )
              })
              .map(|version| PackageNv {
                name: semver_req.name.clone(),
                version,