fn parse_registry_dependency(&self, dep: RegistryDependency)
                                 -> CargoResult<Dependency> {
        let RegistryDependency {
            name, req, features, optional, default_features, target, kind
        } = dep;

        let dep = try!(DependencyInner::parse(&name, Some(&req),
                                              &self.source_id));
        let kind = match kind.as_ref().map(|s| &s[..]).unwrap_or("") {
            "dev" => Kind::Development,
            "build" => Kind::Build,
            _ => Kind::Normal,
        };

        // Unfortunately older versions of cargo and/or the registry ended up
        // publishing lots of entries where the features array contained the
        // empty feature, "", inside. This confuses the resolution process much
        // later on and these features aren't actually valid, so filter them all
        // out here.
        let features = features.into_iter().filter(|s| !s.is_empty()).collect();

        Ok(dep.set_optional(optional)
              .set_default_features(default_features)
              .set_features(features)
              .set_only_for_platform(target)
              .set_kind(kind)
              .into_dependency())
    }
/// Converts an encoded dependency in the registry to a cargo dependency
Converts an encoded dependency in the registry to a cargo dependency
Converts an encoded dependency in the registry to a cargo dependency
fn parse_registry_dependency(&self, dep: RegistryDependency)
                                 -> CargoResult<Dependency> {
        let RegistryDependency {
            name, req, features, optional, default_features, target, kind
        } = dep;
        let dep = try!(DependencyInner::parse(&name, Some(&req),
                                              &self.source_id));
        let kind = match kind.as_ref().map(|s| &s[..]).unwrap_or("") {
            "dev" => Kind::Development,
            "build" => Kind::Build,
            _ => Kind::Normal,
        };
        // Unfortunately older versions of cargo and/or the registry ended up
        // publishing lots of entries where the features array contained the
        // empty feature, "", inside. This confuses the resolution process much
        // later on and these features aren't actually valid, so filter them all
        // out here.
        let features = features.into_iter().filter(|s| !s.is_empty()).collect();
        Ok(dep.set_optional(optional)
              .set_default_features(default_features)
              .set_features(features)
              .set_only_for_platform(target)
              .set_kind(kind)
              .into_dependency())
    }
fn parse_registry_dependency ( & self , dep : RegistryDependency ) -> CargoResult < Dependency > { let RegistryDependency { name , req , features , optional , default_features , target , kind } = dep ; let dep = try ! ( DependencyInner parse ( name Some ( req ) self source_id ) ) ; let kind = match kind . as_ref ( ) . map ( | s | & s [ .. ] ) . unwrap_or ( " " ) { " " => Kind :: Development , " " => Kind :: Build , _ => Kind :: Normal , } ; // Unfortunately older versions of cargo and/or the registry ended up // publishing lots of entries where the features array contained the // empty feature, "", inside. This confuses the resolution process much // later on and these features aren't actually valid, so filter them all // out here. let features = features . into_iter ( ) . filter ( | s | ! s . is_empty ( ) ) . collect ( ) ; Ok ( dep . set_optional ( optional ) . set_default_features ( default_features ) . set_features ( features ) . set_only_for_platform ( target ) . set_kind ( kind ) . into_dependency ( ) ) }
Converts an encoded dependency in the registry to a cargo dependency
Converts an encoded dependency in the registry to a cargo dependency
&self
dep
RegistryDependency
&self
dep
RegistryDependency