diff --git a/src/bootdata.rs b/src/bootdata.rs index 3d9790f..168e7c2 100755 --- a/src/bootdata.rs +++ b/src/bootdata.rs @@ -15,16 +15,6 @@ pub struct BootData { pub version: String, } -fn is_valid(path: &str) -> bool { - let d = PathBuf::from(path); - - if fs::metadata(d.as_path()).is_err() { - return false; - } - - true -} - impl BootData { /// Reads from an existing boot data location. /// @@ -39,7 +29,7 @@ impl BootData { /// # assert!(boot.is_none()) /// ``` pub fn from_existing(directory: &str) -> Option { - match is_valid(directory) { + match Self::is_valid(directory) { true => Some(BootData { path: directory.parse().unwrap(), version: fs::read_to_string(format!("{directory}/ffxivboot.ver")).unwrap(), @@ -55,4 +45,14 @@ impl BootData { pub fn apply_patch(&self, patch_path: &str) -> Result<(), PatchError> { apply_patch(&self.path, patch_path) } + + fn is_valid(path: &str) -> bool { + let d = PathBuf::from(path); + + if fs::metadata(d.as_path()).is_err() { + return false; + } + + true + } }