Browse Source

metadata: simplify read_nrg_chunks()

master
Matteo Cypriani 4 years ago
parent
commit
d5d83ab03e
1 changed files with 5 additions and 21 deletions
  1. +5
    -21
      src/metadata/mod.rs

+ 5
- 21
src/metadata/mod.rs View File

@ -112,27 +112,11 @@ fn read_nrg_chunks(fd: &mut File, nm: &mut NrgMetadata) -> Result<(), NrgError>
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))); },
"CDTX" => {
try!(skip_chunk(fd));
nm.skipped_chunks.push(chunk_id);
},
"ETN2" => {
try!(skip_chunk(fd));
nm.skipped_chunks.push(chunk_id);
},
"SINF" => { nm.sinf_chunk = Some(try!(sinf::read_nrg_sinf(fd))); },
"MTYP" => { nm.mtyp_chunk = Some(try!(mtyp::read_nrg_mtyp(fd))); },
"DINF" => {
try!(skip_chunk(fd));
nm.skipped_chunks.push(chunk_id);
},
"TOCT" => {
try!(skip_chunk(fd));
nm.skipped_chunks.push(chunk_id);
},
"RELO" => {
"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))),
"CDTX" | "ETN2" | "DINF" | "TOCT" | "RELO" => {
try!(skip_chunk(fd));
nm.skipped_chunks.push(chunk_id);
},


Loading…
Cancel
Save