fn produce_targets(&self) -> CargoResult<Vec<BuildableTarget>> {
    let mut targets = Vec::new();
    let package = self.crate_catalog_entry.package();
    for target in &package.targets {
      let manifest_path = PathBuf::from(&package.manifest_path);
      assert!(manifest_path.is_absolute());

      let package_root_path = self.find_package_root_for_manifest(&manifest_path)?;

      // Trim the manifest_path parent dir from the target path (to give us the crate-local path)j
      let mut package_root_path_str = target
        .src_path
        .clone()
        // TODO(acmcarther): Is this even guaranteed to work? I don't think the `display` output
        // can be guaranteed....
        .split_off(package_root_path.display().to_string().len() + 1);

      // Some crates have a weird prefix, trim that.
      if package_root_path_str.starts_with("./") {
        package_root_path_str = package_root_path_str.split_off(2);
      }

      for kind in &target.kind {
        targets.push(BuildableTarget {
          name: target.name.clone(),
          path: package_root_path_str.clone(),
          kind: kind.clone(),
          edition: target.edition.clone(),
        });
      }
    }

    targets.sort();
    Ok(targets)
  }
/**
   * Produces the complete set of build targets specified by this crate.
   *
   * This function may access the file system. See #find_package_root_for_manifest for more
   * details.
   */
Produces the complete set of build targets specified by this crate.
This function may access the file system. See #find_package_root_for_manifest for more
details.
Produces the complete set of build targets specified by this crate . This function may access the file system . See #find_package_root_for_manifest for more details .
fn produce_targets(&self) -> CargoResult<Vec<BuildableTarget>> {
    let mut targets = Vec::new();
    let package = self.crate_catalog_entry.package();
    for target in &package.targets {
      let manifest_path = PathBuf::from(&package.manifest_path);
      assert!(manifest_path.is_absolute());
      let package_root_path = self.find_package_root_for_manifest(&manifest_path)?;
      // Trim the manifest_path parent dir from the target path (to give us the crate-local path)j
      let mut package_root_path_str = target
        .src_path
        .clone()
        // TODO(acmcarther): Is this even guaranteed to work? I don't think the `display` output
        // can be guaranteed....
        .split_off(package_root_path.display().to_string().len() + 1);
      // Some crates have a weird prefix, trim that.
      if package_root_path_str.starts_with("./") {
        package_root_path_str = package_root_path_str.split_off(2);
      }
      for kind in &target.kind {
        targets.push(BuildableTarget {
          name: target.name.clone(),
          path: package_root_path_str.clone(),
          kind: kind.clone(),
          edition: target.edition.clone(),
        });
      }
    }
    targets.sort();
    Ok(targets)
  }
fn produce_targets ( & self ) -> CargoResult < Vec < BuildableTarget > > { let mut targets = Vec :: new ( ) ; let package = self . crate_catalog_entry . package ( ) ; for target in & package . targets { let manifest_path = PathBuf :: from ( & package . manifest_path ) ; assert ! ( manifest_path is_absolute ( ) ) ; let package_root_path = self . find_package_root_for_manifest ( & manifest_path ) ? ; // Trim the manifest_path parent dir from the target path (to give us the crate-local path)j let mut package_root_path_str = target . src_path . clone ( ) // TODO(acmcarther): Is this even guaranteed to work? I don't think the `display` output // can be guaranteed.... . split_off ( package_root_path . display ( ) . to_string ( ) . len ( ) + 1 ) ; // Some crates have a weird prefix, trim that. if package_root_path_str . starts_with ( " " ) { package_root_path_str = package_root_path_str . split_off ( 2 ) ; } for kind in & target . kind { targets . push ( BuildableTarget { name : target . name . clone ( ) , path : package_root_path_str . clone ( ) , kind : kind . clone ( ) , edition : target . edition . clone ( ) , } ) ; } } targets . sort ( ) ; Ok ( targets ) }
Produces the complete set of build targets specified by this crate.
Produces the complete set of build targets specified by this crate .
&self