From a0357b3ee32481e2e6b0bc59e11b91c5762fb3c2 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Tue, 2 Mar 2021 20:32:24 -0600 Subject: [PATCH] fix(client): Remove tracked_files property Maybe there might be value in looking to caching values from the database, but as of right now it's complexity that doesn't really makes sense since the program never lives long enough for us to ever use the cache. --- client/src/archive.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) 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(()) }