mirror of
https://github.com/redstrate/Physis.git
synced 2025-06-07 15:17:45 +00:00
Remove unwrap in tex parsing
This commit is contained in:
parent
1071ae0ccd
commit
b0047dd77d
2 changed files with 4 additions and 4 deletions
|
@ -133,7 +133,7 @@ impl Texture {
|
||||||
/// Reads an existing TEX file
|
/// Reads an existing TEX file
|
||||||
pub fn from_existing(buffer: ByteSpan) -> Option<Texture> {
|
pub fn from_existing(buffer: ByteSpan) -> Option<Texture> {
|
||||||
let mut cursor = Cursor::new(buffer);
|
let mut cursor = Cursor::new(buffer);
|
||||||
let header = TexHeader::read(&mut cursor).unwrap();
|
let header = TexHeader::read(&mut cursor).ok()?;
|
||||||
|
|
||||||
cursor
|
cursor
|
||||||
.seek(SeekFrom::Start(std::mem::size_of::<TexHeader>() as u64))
|
.seek(SeekFrom::Start(std::mem::size_of::<TexHeader>() as u64))
|
||||||
|
|
Loading…
Add table
Reference in a new issue