fn parse(config: &Config, line: &[u8], source_id: SourceId) -> CargoResult<IndexSummary> {
        // ****CAUTION**** Please be extremely careful with returning errors
        // from this function. Entries that error are not included in the
        // index cache, and can cause cargo to get confused when switching
        // between different versions that understand the index differently.
        // Make sure to consider the INDEX_V_MAX and CURRENT_CACHE_VERSION
        // values carefully when making changes here.
        let RegistryPackage {
            name,
            vers,
            cksum,
            deps,
            mut features,
            features2,
            yanked,
            links,
            v,
        } = serde_json::from_slice(line)?;
        let v = v.unwrap_or(1);
        log::trace!("json parsed registry {}/{}", name, vers);
        let pkgid = PackageId::new(name, &vers, source_id)?;
        let deps = deps
            .into_iter()
            .map(|dep| dep.into_dep(source_id))
            .collect::<CargoResult<Vec<_>>>()?;
        if let Some(features2) = features2 {
            for (name, values) in features2 {
                features.entry(name).or_default().extend(values);
            }
        }
        let mut summary = Summary::new(config, pkgid, deps, &features, links)?;
        summary.set_checksum(cksum);
        Ok(IndexSummary {
            summary,
            yanked: yanked.unwrap_or(false),
            v,
        })
    }
/// Parses a line from the registry's index file into an `IndexSummary` for
/// a package.
///
/// The `line` provided is expected to be valid JSON.
Parses a line from the registry's index file into an `IndexSummary` for
a package.

The `line` provided is expected to be valid JSON.
Parses a line from the registry ' s index file into an ` IndexSummary ` for a package . The ` line ` provided is expected to be valid JSON .
fn parse(config: &Config, line: &[u8], source_id: SourceId) -> CargoResult<IndexSummary> {
        // ****CAUTION**** Please be extremely careful with returning errors
        // from this function. Entries that error are not included in the
        // index cache, and can cause cargo to get confused when switching
        // between different versions that understand the index differently.
        // Make sure to consider the INDEX_V_MAX and CURRENT_CACHE_VERSION
        // values carefully when making changes here.
        let RegistryPackage {
            name,
            vers,
            cksum,
            deps,
            mut features,
            features2,
            yanked,
            links,
            v,
        } = serde_json::from_slice(line)?;
        let v = v.unwrap_or(1);
        log::trace!("json parsed registry {}/{}", name, vers);
        let pkgid = PackageId::new(name, &vers, source_id)?;
        let deps = deps
            .into_iter()
            .map(|dep| dep.into_dep(source_id))
            .collect::<CargoResult<Vec<_>>>()?;
        if let Some(features2) = features2 {
            for (name, values) in features2 {
                features.entry(name).or_default().extend(values);
            }
        }
        let mut summary = Summary::new(config, pkgid, deps, &features, links)?;
        summary.set_checksum(cksum);
        Ok(IndexSummary {
            summary,
            yanked: yanked.unwrap_or(false),
            v,
        })
    }
fn parse ( config : & Config , line : & [ u8 ] , source_id : SourceId ) -> CargoResult < IndexSummary > { // ****CAUTION**** Please be extremely careful with returning errors // from this function. Entries that error are not included in the // index cache, and can cause cargo to get confused when switching // between different versions that understand the index differently. // Make sure to consider the INDEX_V_MAX and CURRENT_CACHE_VERSION // values carefully when making changes here. let RegistryPackage { name , vers , cksum , deps , mut features , features2 , yanked , links , v , } = serde_json :: from_slice ( line ) ? ; let v = v . unwrap_or ( 1 ) ; log :: trace ! ( " " name vers ) ; let pkgid = PackageId :: new ( name , & vers , source_id ) ? ; let deps = deps . into_iter ( ) . map ( | dep | dep . into_dep ( source_id ) ) . collect :: < CargoResult < Vec < _ > > > ( ) ? ; if let Some ( features2 ) = features2 { for ( name , values ) in features2 { features . entry ( name ) . or_default ( ) . extend ( values ) ; } } let mut summary = Summary :: new ( config , pkgid , deps , & features , links ) ? ; summary . set_checksum ( cksum ) ; Ok ( IndexSummary { summary , yanked : yanked . unwrap_or ( false ) , v , } ) }
Parses a line from the registry's index file into an `IndexSummary` for
a package.
Parses a line from the registry ' s index file into an ` IndexSummary ` for a package .
config
&Config
line
&[u8]
source_id
SourceId
config
&Config
line
&[u8]
source_id
SourceId