diff --git a/client/src/archive.rs b/client/src/archive.rs index eb89d29..d15dd1f 100644 --- a/client/src/archive.rs +++ b/client/src/archive.rs @@ -8,7 +8,6 @@ use walkdir::WalkDir; #[derive(Debug, Clone)] pub struct Archive { - tracked_games: Vec, data_root: PathBuf, config_root: PathBuf, } @@ -32,7 +31,6 @@ impl Archive { debug!("Created default Archive with: {:?} and {:?}", data, config); Ok(Self { - tracked_games: Vec::new(), data_root: data, config_root: config, }) @@ -59,7 +57,6 @@ impl Archive { ); Self { - tracked_games: Vec::new(), data_root: data_root.to_path_buf(), config_root: config_root.to_path_buf(), } @@ -86,10 +83,7 @@ impl Archive { /// ``` pub fn track_game>(&mut self, path: P) -> Result<(), GameTrackError> { let game_save_loc = self.get_game_save_files(path, None)?; - - Self::write_game_save(&game_save_loc); - - self.tracked_games.push(game_save_loc); + Self::write_game_save(&game_save_loc)?; Ok(()) } @@ -115,10 +109,7 @@ impl Archive { P: AsRef, { let game_save_loc = self.get_game_save_files(path, Some(name))?; - - Self::write_game_save(&game_save_loc); - - self.tracked_games.push(game_save_loc); + Self::write_game_save(&game_save_loc)?; Ok(()) }