pub fn resolve_pkg_spec(spec: Option<&str>) -> anyhow::Result<PackageSpec> {
    let mut cmd = Command::new(cargo_path());
    cmd.arg("pkgid");
    if let Some(spec) = spec {
        cmd.arg("--").arg(spec);
    }
    let output = cmd.output().context("")?;
    if output.status.success() {
        let out = String::from_utf8(output.stdout).expect("cargo pkgid did not return valid UTF8");
        Ok(out
            .trim_end()
            .parse::<PackageSpec>()
            .unwrap_or_else(|e| panic!("Unable to parse pkgid {:?}: {}", out, e)))
    } else {
        Err(anyhow::Error::from(PackageResolveError {
            spec: spec.map(String::from),
            message: String::from_utf8(output.stderr)
                .expect("cargo pkgid did not return valid UTF8"),
        }))
    }
}
/// Resolve the specified package specification by running `cargo pkgid`
///
/// Failsw ith
Resolve the specified package specification by running `cargo pkgid`
Failsw ith
Resolve the specified package specification by running ` cargo pkgid ` Failsw ith
pub fn resolve_pkg_spec(spec: Option<&str>) -> anyhow::Result<PackageSpec> {
    let mut cmd = Command::new(cargo_path());
    cmd.arg("pkgid");
    if let Some(spec) = spec {
        cmd.arg("--").arg(spec);
    }
    let output = cmd.output().context("")?;
    if output.status.success() {
        let out = String::from_utf8(output.stdout).expect("cargo pkgid did not return valid UTF8");
        Ok(out
            .trim_end()
            .parse::<PackageSpec>()
            .unwrap_or_else(|e| panic!("Unable to parse pkgid {:?}: {}", out, e)))
    } else {
        Err(anyhow::Error::from(PackageResolveError {
            spec: spec.map(String::from),
            message: String::from_utf8(output.stderr)
                .expect("cargo pkgid did not return valid UTF8"),
        }))
    }
}
pub fn resolve_pkg_spec ( spec : Option < & str > ) -> anyhow :: Result < PackageSpec > { let mut cmd = Command :: new ( cargo_path ( ) ) ; cmd . arg ( " " ) ; if let Some ( spec ) = spec { cmd . arg ( " " ) . arg ( spec ) ; } let output = cmd . output ( ) . context ( " " ) ? ; if output . status . success ( ) { let out = String :: from_utf8 ( output . stdout ) . expect ( " " ) ; Ok ( out . trim_end ( ) . parse :: < PackageSpec > ( ) . unwrap_or_else ( | e | panic ! ( " " out e ) ) ) } else { Err ( anyhow :: Error :: from ( PackageResolveError { spec : spec . map ( String :: from ) , message : String :: from_utf8 ( output . stderr ) . expect ( " " ) , } ) ) } }
Resolve the specified package specification by running `cargo pkgid`
Failsw ith
Resolve the specified package specification by running ` cargo pkgid ` Failsw ith
spec
Option<&str>