fn produce_deps(&self) -> Result<DepProduction> {
    let mut dep_production = DepProduction::new();

    let all_skipped_deps = self
      .crate_settings
      .iter()
      .flat_map(|pkg| pkg.skipped_deps.iter())
      .collect::<HashSet<_>>();

    // This wonderful part of the metadata gives us both renames and targets.
    //
    // Irritatingly its still a little tricky to detect renames fully, we need this to finally
    // deduce the aliases - see `is_renamed`.
    //
    // If https://github.com/rust-lang/cargo/issues/7289 gets solved then a lot of the left-over
    // rename detection code can get removed.
    for dep in &self.node.deps {
      // UNWRAP(s): Safe from verification of packages_by_id
      let dep_package = self
        .crate_catalog
        .entry_for_package_id(&dep.pkg)
        .unwrap()
        .package();

      // Skip settings-indicated deps to skip
      let pkg_id = util::package_ident(&dep_package.name, &dep_package.version.to_string());
      if all_skipped_deps.contains(&pkg_id) {
        continue;
      }

      // TODO(https://github.com/google/cargo-raze/issues/424):
      // Reimplement what cargo does to detect bad renames
      //
      // The problem manifests from this:
      //
      // ```toml
      // [dependencies]
      // bytes_new = { version = "0.3.0", package = "bytes" }
      // bytes_old = { version = "0.3.0", package = "bytes" }
      // ```
      //
      // Strictly this is an error. Right now cargo metadata will basically lose both bytes deps
      // from the resolve graph :gruntle: but a cargo build will scream about having the same basic
      // package with multiple names.
      //
      // Currently there is no good solution using metadata. Pull requests welcome!
      for dep_kind in &dep.dep_kinds {
        let platform_target = dep_kind.target.as_ref().map(|x| x.to_string());
        // Skip deps that fall out of targetting
        if !self.is_dep_targetted(platform_target.as_ref()) {
          continue;
        }

        self.process_dep(
          dep_production.entry(platform_target).or_default(),
          &dep.name,
          dep_kind,
          dep_package,
        )?
      }
    }

    Ok(dep_production)
  }
/// Generates the set of dependencies for the contained crate.
Generates the set of dependencies for the contained crate.
Generates the set of dependencies for the contained crate .
fn produce_deps(&self) -> Result<DepProduction> {
    let mut dep_production = DepProduction::new();
    let all_skipped_deps = self
      .crate_settings
      .iter()
      .flat_map(|pkg| pkg.skipped_deps.iter())
      .collect::<HashSet<_>>();
    // This wonderful part of the metadata gives us both renames and targets.
    //
    // Irritatingly its still a little tricky to detect renames fully, we need this to finally
    // deduce the aliases - see `is_renamed`.
    //
    // If https://github.com/rust-lang/cargo/issues/7289 gets solved then a lot of the left-over
    // rename detection code can get removed.
    for dep in &self.node.deps {
      // UNWRAP(s): Safe from verification of packages_by_id
      let dep_package = self
        .crate_catalog
        .entry_for_package_id(&dep.pkg)
        .unwrap()
        .package();
      // Skip settings-indicated deps to skip
      let pkg_id = util::package_ident(&dep_package.name, &dep_package.version.to_string());
      if all_skipped_deps.contains(&pkg_id) {
        continue;
      }
      // TODO(https://github.com/google/cargo-raze/issues/424):
      // Reimplement what cargo does to detect bad renames
      //
      // The problem manifests from this:
      //
      // ```toml
      // [dependencies]
      // bytes_new = { version = "0.3.0", package = "bytes" }
      // bytes_old = { version = "0.3.0", package = "bytes" }
      // ```
      //
      // Strictly this is an error. Right now cargo metadata will basically lose both bytes deps
      // from the resolve graph :gruntle: but a cargo build will scream about having the same basic
      // package with multiple names.
      //
      // Currently there is no good solution using metadata. Pull requests welcome!
      for dep_kind in &dep.dep_kinds {
        let platform_target = dep_kind.target.as_ref().map(|x| x.to_string());
        // Skip deps that fall out of targetting
        if !self.is_dep_targetted(platform_target.as_ref()) {
          continue;
        }
        self.process_dep(
          dep_production.entry(platform_target).or_default(),
          &dep.name,
          dep_kind,
          dep_package,
        )?
      }
    }
    Ok(dep_production)
  }
fn produce_deps ( & self ) -> Result < DepProduction > { let mut dep_production = DepProduction :: new ( ) ; let all_skipped_deps = self . crate_settings . iter ( ) . flat_map ( | pkg | pkg . skipped_deps . iter ( ) ) . collect :: < HashSet < _ > > ( ) ; // This wonderful part of the metadata gives us both renames and targets. // // Irritatingly its still a little tricky to detect renames fully, we need this to finally // deduce the aliases - see `is_renamed`. // // If https://github.com/rust-lang/cargo/issues/7289 gets solved then a lot of the left-over // rename detection code can get removed. for dep in & self . node . deps { // UNWRAP(s): Safe from verification of packages_by_id let dep_package = self . crate_catalog . entry_for_package_id ( & dep . pkg ) . unwrap ( ) . package ( ) ; // Skip settings-indicated deps to skip let pkg_id = util :: package_ident ( & dep_package . name , & dep_package . version . to_string ( ) ) ; if all_skipped_deps . contains ( & pkg_id ) { continue ; } // TODO(https://github.com/google/cargo-raze/issues/424): // Reimplement what cargo does to detect bad renames // // The problem manifests from this: // // ```toml // [dependencies] // bytes_new = { version = "0.3.0", package = "bytes" } // bytes_old = { version = "0.3.0", package = "bytes" } // ``` // // Strictly this is an error. Right now cargo metadata will basically lose both bytes deps // from the resolve graph :gruntle: but a cargo build will scream about having the same basic // package with multiple names. // // Currently there is no good solution using metadata. Pull requests welcome! for dep_kind in & dep . dep_kinds { let platform_target = dep_kind . target . as_ref ( ) . map ( | x | x . to_string ( ) ) ; // Skip deps that fall out of targetting if ! self . is_dep_targetted ( platform_target . as_ref ( ) ) { continue ; } self . process_dep ( dep_production . entry ( platform_target ) . or_default ( ) , & dep . name , dep_kind , dep_package , ) ? } } Ok ( dep_production ) }
Generates the set of dependencies for the contained crate.
Generates the set of dependencies for the contained crate .
&self
&self