diff --git a/src/bootdata.rs b/src/bootdata.rs index 8b3291f..8511109 100755 --- a/src/bootdata.rs +++ b/src/bootdata.rs @@ -1,6 +1,5 @@ use std::fs; use std::path::PathBuf; -use crate::gamedata::MemoryBuffer; use crate::patch::{apply_patch, PatchError}; /// Boot data for FFXIV. diff --git a/src/fiin.rs b/src/fiin.rs index f4f4178..b0667ba 100644 --- a/src/fiin.rs +++ b/src/fiin.rs @@ -1,4 +1,3 @@ -use std::ffi::CString; use std::fs::read; use std::io::Cursor; use binrw::binrw; diff --git a/src/gamedata.rs b/src/gamedata.rs index 1c09274..5555001 100755 --- a/src/gamedata.rs +++ b/src/gamedata.rs @@ -1,6 +1,6 @@ use std::fs; use std::fs::DirEntry; -use std::path::{Path, PathBuf}; +use std::path::PathBuf; use crate::common::Language; use crate::dat::DatFile; use crate::exd::EXD; diff --git a/src/log.rs b/src/log.rs index 200ed9b..4383e59 100644 --- a/src/log.rs +++ b/src/log.rs @@ -1,5 +1,4 @@ use std::io::{Cursor, Seek, SeekFrom}; -use std::os::unix::raw::time_t; use binrw::binread; use crate::gamedata::MemoryBuffer; use binrw::BinRead; @@ -71,7 +70,7 @@ impl ChatLog { let content_offset = (8 + header.file_size * 4) as u64; // beginning of content offset - cursor.seek(SeekFrom::Start(content_offset)); + cursor.seek(SeekFrom::Start(content_offset)).ok()?; let mut entries = vec![]; @@ -83,7 +82,7 @@ impl ChatLog { // TODO: handle the coloring properly, in some way entry.message = String::from_utf8_lossy(&*buffer[cursor.position() as usize..new_last_offset as usize].to_vec()).to_string(); - cursor.seek(SeekFrom::Start(new_last_offset)); + cursor.seek(SeekFrom::Start(new_last_offset)).ok()?; entries.push(entry); }