From ef5ca45a72106cffddfff4f57f1eef652670bb3b Mon Sep 17 00:00:00 2001 From: diogo464 Date: Thu, 23 Dec 2021 19:50:03 +0000 Subject: removed unneeded struct DepotShared --- dotup/src/depot.rs | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/dotup/src/depot.rs b/dotup/src/depot.rs index 5ee8f1a..d1e0946 100644 --- a/dotup/src/depot.rs +++ b/dotup/src/depot.rs @@ -3,7 +3,6 @@ use std::{ collections::HashMap, fs::Metadata, path::{Path, PathBuf}, - sync::Arc, }; use thiserror::Error; @@ -150,17 +149,11 @@ impl std::fmt::Display for Link { } #[derive(Debug)] -struct DepotShared { - /// Must be canonical path +pub struct Depot { + // Must be canonical path base_path: PathBuf, - /// Must be canonical path + // Must be canonical path archive_path: PathBuf, -} - -#[derive(Debug)] -pub struct Depot { - // TODO: remove shared - shared: Arc, // Maps the origin to the link links: SlotMap, links_by_origin: HashMap, @@ -212,11 +205,11 @@ impl Depot { } pub fn base_path(&self) -> &Path { - &self.shared.base_path + &self.base_path } pub fn archive_path(&self) -> &Path { - &self.shared.archive_path + &self.archive_path } } @@ -233,13 +226,9 @@ fn depot_create(config: DepotConfig) -> Result { .expect("Failed to get parent of archive path") .to_path_buf(); - let depot_shared = DepotShared { + let mut depot = Depot { base_path, archive_path, - }; - - let mut depot = Depot { - shared: Arc::new(depot_shared), links: Default::default(), links_by_origin: Default::default(), }; -- cgit