Skip to content

Commit

Permalink
fix: missed panic points after result fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bddvlpr committed Jun 28, 2024
1 parent c0c5696 commit c372bb7
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions unitypkg-core/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,22 @@ pub fn read_package<R: Read>(r: R) -> Result<Package, PackageReadError> {
match asset_path {
"pathname" => {
let mut pathname = String::new();
entry
.read_to_string(&mut pathname)
.expect("Cannot read pathname of asset");
entry.read_to_string(&mut pathname)?;
builder.pathname = Some(pathname);
}
"preview.png" => {
let mut preview = Vec::new();
entry
.read_to_end(&mut preview)
.expect("Cannot read preview of asset");
entry.read_to_end(&mut preview)?;
builder.preview = Some(preview);
}
"asset.meta" => {
let mut meta = Vec::new();
entry
.read_to_end(&mut meta)
.expect("Cannot read meta of asset");
entry.read_to_end(&mut meta)?;
builder.meta = Some(meta);
}
"asset" => {
let mut data = Vec::new();
entry
.read_to_end(&mut data)
.expect("Cannot read data of asset");
entry.read_to_end(&mut data)?;
builder.data = Some(data);
}
_ => {}
Expand Down

0 comments on commit c372bb7

Please sign in to comment.