pub fn parse_as_version(&self) -> Result<Option<Dependency>> {
        if self.has_version() {
            let xs: Vec<_> = self.0.splitn(2, '@').collect();
            let (name, version) = (xs[0], xs[1]);
            semver::VersionReq::parse(version).chain_err(|| "Invalid crate version requirement")?;

            Ok(Some(Dependency::new(name).set_version(version)))
        } else {
            Ok(None)
        }
    }
/// If this crate specifier includes a version (e.g. `docopt@0.8`), extract the name and
/// version.
If this crate specifier includes a version , extract the name and
version.
If this crate specifier includes a version extract the name and version .
pub fn parse_as_version(&self) -> Result<Option<Dependency>> {
        if self.has_version() {
            let xs: Vec<_> = self.0.splitn(2, '@').collect();
            let (name, version) = (xs[0], xs[1]);
            semver::VersionReq::parse(version).chain_err(|| "Invalid crate version requirement")?;
            Ok(Some(Dependency::new(name).set_version(version)))
        } else {
            Ok(None)
        }
    }
pub fn parse_as_version ( & self ) -> Result < Option < Dependency > > { if self . has_version ( ) { let xs : Vec < _ > = self . 0 . splitn ( 2 , '@' ) . collect ( ) ; let ( name , version ) = ( xs [ 0 ] , xs [ 1 ] ) ; semver :: VersionReq :: parse ( version ) . chain_err ( | | " " ) ? ; Ok ( Some ( Dependency :: new ( name ) . set_version ( version ) ) ) } else { Ok ( None ) } }
If this crate specifier includes a version (e.g.
If this crate specifier includes a version ( e . g .
&self