pub fn find_direct_dependency(
        &self,
        dependency_name: &str,
        dependent_package_name: &str,
    ) -> CargoResult<PackageId> {
        let dependent_package = self.find_contained_package(dependent_package_name)?;
        for direct_dep in self.pkg_deps[&dependent_package].keys() {
            if direct_dep.name().as_str() == dependency_name {
                return Ok(direct_dep.clone());
            }
        }
        Err(format_err!(
            "Direct dependency {} not found for package {}",
            dependency_name,
            dependent_package_name
        ))
    }
/// Find a direct dependency of a contained package
Find a direct dependency of a contained package
Find a direct dependency of a contained package
pub fn find_direct_dependency(
        &self,
        dependency_name: &str,
        dependent_package_name: &str,
    ) -> CargoResult<PackageId> {
        let dependent_package = self.find_contained_package(dependent_package_name)?;
        for direct_dep in self.pkg_deps[&dependent_package].keys() {
            if direct_dep.name().as_str() == dependency_name {
                return Ok(direct_dep.clone());
            }
        }
        Err(format_err!(
            "Direct dependency {} not found for package {}",
            dependency_name,
            dependent_package_name
        ))
    }
pub fn find_direct_dependency ( & self , dependency_name : & str , dependent_package_name : & str , ) -> CargoResult < PackageId > { let dependent_package = self . find_contained_package ( dependent_package_name ) ? ; for direct_dep in self . pkg_deps [ & dependent_package ] . keys ( ) { if direct_dep . name ( ) . as_str ( ) == dependency_name { return Ok ( direct_dep . clone ( ) ) ; } } Err ( format_err ! ( " " dependency_name dependent_package_name ) ) }
Find a direct dependency of a contained package
Find a direct dependency of a contained package
&self
dependency_name
&str
dependent_package_name
&str