fn parse(
        &mut self,
        config: &Config,
        raw_data: &[u8],
        source_id: SourceId,
    ) -> CargoResult<&IndexSummary> {
        let (start, end) = match self {
            MaybeIndexSummary::Unparsed { start, end } => (*start, *end),
            MaybeIndexSummary::Parsed(summary) => return Ok(summary),
        };
        let summary = IndexSummary::parse(config, &raw_data[start..end], source_id)?;
        *self = MaybeIndexSummary::Parsed(summary);
        match self {
            MaybeIndexSummary::Unparsed { .. } => unreachable!(),
            MaybeIndexSummary::Parsed(summary) => Ok(summary),
        }
    }
/// Parses this "maybe a summary" into a `Parsed` for sure variant.
///
/// Does nothing if this is already `Parsed`, and otherwise the `raw_data`
/// passed in is sliced with the bounds in `Unparsed` and then actually
/// parsed.
Parses this "maybe a summary" into a `Parsed` for sure variant.
Parses this " maybe a summary " into a ` Parsed ` for sure variant .
fn parse(
        &mut self,
        config: &Config,
        raw_data: &[u8],
        source_id: SourceId,
    ) -> CargoResult<&IndexSummary> {
        let (start, end) = match self {
            MaybeIndexSummary::Unparsed { start, end } => (*start, *end),
            MaybeIndexSummary::Parsed(summary) => return Ok(summary),
        };
        let summary = IndexSummary::parse(config, &raw_data[start..end], source_id)?;
        *self = MaybeIndexSummary::Parsed(summary);
        match self {
            MaybeIndexSummary::Unparsed { .. } => unreachable!(),
            MaybeIndexSummary::Parsed(summary) => Ok(summary),
        }
    }
fn parse ( & mut self , config : & Config , raw_data : & [ u8 ] , source_id : SourceId , ) -> CargoResult < & IndexSummary > { let ( start , end ) = match self { MaybeIndexSummary :: Unparsed { start , end } => ( * start , * end ) , MaybeIndexSummary :: Parsed ( summary ) => return Ok ( summary ) , } ; let summary = IndexSummary :: parse ( config , & raw_data [ start .. end ] , source_id ) ? ; * self = MaybeIndexSummary :: Parsed ( summary ) ; match self { MaybeIndexSummary :: Unparsed { .. } => unreachable ! ( ) , MaybeIndexSummary :: Parsed ( summary ) => Ok ( summary ) , } }
Parses this "maybe a summary" into a `Parsed` for sure variant.
Parses this " maybe a summary " into a ` Parsed ` for sure variant .
&mut self
config
&Config
raw_data
&[u8]
source_id
SourceId
&mut self
config
&Config
raw_data
&[u8]
source_id
SourceId