fn read_nrg_chunks(fd: &mut File, nm: &mut NrgMetadata) -> Result<(), NrgError> {
    loop {
        let chunk_id = try!(read_nrg_chunk_id(fd));
        match chunk_id.as_ref() {
            "END!" => break,
            "CUEX" => nm.cuex_chunk = Some(try!(cuex::read_nrg_cuex(fd))),
            "DAOX" => nm.daox_chunk = Some(try!(daox::read_nrg_daox(fd))),
            "SINF" => nm.sinf_chunk = Some(try!(sinf::read_nrg_sinf(fd))),
            "MTYP" => nm.mtyp_chunk = Some(try!(mtyp::read_nrg_mtyp(fd))),
            "AFNM" => nm.afnm_chunk = Some(try!(afnm::read_nrg_afnm(fd))),
            "CDTX" | "ETN2" | "DINF" | "TOCT" | "RELO" | "VOLM" => {
                try!(skip_chunk(fd));
                nm.skipped_chunks.push(chunk_id);
            },
            _      => return Err(NrgError::NrgChunkId(chunk_id)),
        }
    }
    Ok(())
}
/// Reads all the available NRG chunks.
///
/// Returns the number of chunks read.
Reads all the available NRG chunks.
Returns the number of chunks read.
Reads all the available NRG chunks . Returns the number of chunks read .
fn read_nrg_chunks(fd: &mut File, nm: &mut NrgMetadata) -> Result<(), NrgError> {
    loop {
        let chunk_id = try!(read_nrg_chunk_id(fd));
        match chunk_id.as_ref() {
            "END!" => break,
            "CUEX" => nm.cuex_chunk = Some(try!(cuex::read_nrg_cuex(fd))),
            "DAOX" => nm.daox_chunk = Some(try!(daox::read_nrg_daox(fd))),
            "SINF" => nm.sinf_chunk = Some(try!(sinf::read_nrg_sinf(fd))),
            "MTYP" => nm.mtyp_chunk = Some(try!(mtyp::read_nrg_mtyp(fd))),
            "AFNM" => nm.afnm_chunk = Some(try!(afnm::read_nrg_afnm(fd))),
            "CDTX" | "ETN2" | "DINF" | "TOCT" | "RELO" | "VOLM" => {
                try!(skip_chunk(fd));
                nm.skipped_chunks.push(chunk_id);
            },
            _      => return Err(NrgError::NrgChunkId(chunk_id)),
        }
    }
    Ok(())
}
fn read_nrg_chunks ( fd : & mut File , nm : & mut NrgMetadata ) -> Result < ( ) , NrgError > { loop { let chunk_id = try ! ( read_nrg_chunk_id ( fd ) ) ; match chunk_id . as_ref ( ) { " " => break , " " => nm . cuex_chunk = Some ( try ! ( cuex read_nrg_cuex ( fd ) ) ) , " " => nm . daox_chunk = Some ( try ! ( daox read_nrg_daox ( fd ) ) ) , " " => nm . sinf_chunk = Some ( try ! ( sinf read_nrg_sinf ( fd ) ) ) , " " => nm . mtyp_chunk = Some ( try ! ( mtyp read_nrg_mtyp ( fd ) ) ) , " " => nm . afnm_chunk = Some ( try ! ( afnm read_nrg_afnm ( fd ) ) ) , " " | " " | " " | " " | " " | " " => { try ! ( skip_chunk ( fd ) ) ; nm . skipped_chunks . push ( chunk_id ) ; } , _ => return Err ( NrgError :: NrgChunkId ( chunk_id ) ) , } } Ok ( ( ) ) }
Reads all the available NRG chunks.
Reads all the available NRG chunks .
fd
&mut File
nm
&mut NrgMetadata
fd
&mut File
nm
&mut NrgMetadata