fn package_versions(manifests: &[Manifest]) -> Result<BTreeMap<String, Version>> {
    let mut versions = BTreeMap::new();
    for manifest in manifests {
        let name = manifest.metadata["package"]["name"]
            .as_str()
            .ok_or_else(|| {
                anyhow::Error::msg(format!("{:?} is missing a package name", manifest.path))
            })?;
        let version = manifest.metadata["package"]["version"]
            .as_str()
            .ok_or_else(|| {
                anyhow::Error::msg(format!("{:?} is missing a package version", manifest.path))
            })?;
        let version = parse_version(&manifest.path, version)?;
        versions.insert(name.into(), version);
    }
    Ok(versions)
}
/// Returns a map of crate name to semver version number
Returns a map of crate name to semver version number
Returns a map of crate name to semver version number
fn package_versions(manifests: &[Manifest]) -> Result<BTreeMap<String, Version>> {
    let mut versions = BTreeMap::new();
    for manifest in manifests {
        let name = manifest.metadata["package"]["name"]
            .as_str()
            .ok_or_else(|| {
                anyhow::Error::msg(format!("{:?} is missing a package name", manifest.path))
            })?;
        let version = manifest.metadata["package"]["version"]
            .as_str()
            .ok_or_else(|| {
                anyhow::Error::msg(format!("{:?} is missing a package version", manifest.path))
            })?;
        let version = parse_version(&manifest.path, version)?;
        versions.insert(name.into(), version);
    }
    Ok(versions)
}
fn package_versions ( manifests : & [ Manifest ] ) -> Result < BTreeMap < String , Version > > { let mut versions = BTreeMap :: new ( ) ; for manifest in manifests { let name = manifest . metadata [ " " ] [ " " ] . as_str ( ) . ok_or_else ( | | { anyhow :: Error :: msg ( format ! ( " " manifest path ) ) } ) ? ; let version = manifest . metadata [ " " ] [ " " ] . as_str ( ) . ok_or_else ( | | { anyhow :: Error :: msg ( format ! ( " " manifest path ) ) } ) ? ; let version = parse_version ( & manifest . path , version ) ? ; versions . insert ( name . into ( ) , version ) ; } Ok ( versions ) }
Returns a map of crate name to semver version number
Returns a map of crate name to semver version number
manifests
&[Manifest]
manifests
&[Manifest]