summaryrefslogtreecommitdiff
path: root/src/backup.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/backup.rs')
-rw-r--r--src/backup.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backup.rs b/src/backup.rs
index a643cb2..675f020 100644
--- a/src/backup.rs
+++ b/src/backup.rs
@@ -20,7 +20,7 @@ pub type BackupId = String;
20#[derive(Debug, Serialize, Deserialize)] 20#[derive(Debug, Serialize, Deserialize)]
21pub struct Backup { 21pub struct Backup {
22 pub id: String, 22 pub id: String,
23 timestamp: u64, 23 pub timestamp: u64,
24 packages: Vec<Package>, 24 packages: Vec<Package>,
25 pub files: Vec<PathInfo>, 25 pub files: Vec<PathInfo>,
26 device: String, 26 device: String,
@@ -74,16 +74,16 @@ impl Backup {
74 74
75 Ok(Some(Self::from_index( 75 Ok(Some(Self::from_index(
76 config, 76 config,
77 list.last().ok_or(Error::BackupNotFound)?.id.clone(), 77 &list.last().ok_or(Error::BackupNotFound)?.id,
78 )?)) 78 )?))
79 } 79 }
80 80
81 pub fn from_index(config: &Config, id: BackupId) -> Result<Self> { 81 pub fn from_index(config: &Config, id: &BackupId) -> Result<Self> {
82 let backup_index_root = format!("{}/index.json", config.root); 82 let backup_index_root = format!("{}/index.json", config.root);
83 let list: Vec<BackupLocation> = Self::get_json_content(&backup_index_root)?; 83 let list: Vec<BackupLocation> = Self::get_json_content(&backup_index_root)?;
84 let index_loc = list 84 let index_loc = list
85 .iter() 85 .iter()
86 .find(|bl| bl.id == id) 86 .find(|bl| &bl.id == id)
87 .ok_or(Error::BackupNotFound)? 87 .ok_or(Error::BackupNotFound)?
88 .rel_location 88 .rel_location
89 .clone(); 89 .clone();