summaryrefslogtreecommitdiff
path: root/src/backup_run.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-08-01 20:34:35 +0300
committerLars Wirzenius <liw@liw.fi>2021-08-01 20:55:04 +0300
commit2bc07b176bcf63f94bf6f1cca0ade2505958a15d (patch)
treee1dcf85cc76051baf44a63c1105ced26935109c2 /src/backup_run.rs
parent0835677f33fe8fa89ee96e4c1b45e5711e10b461 (diff)
downloadobnam2-2bc07b176bcf63f94bf6f1cca0ade2505958a15d.tar.gz
refactor: add a type alias for generation ids
This will make it harder to accidentally use a string. Can still be confused with a chunk id. Sponsored-by: author
Diffstat (limited to 'src/backup_run.rs')
-rw-r--r--src/backup_run.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backup_run.rs b/src/backup_run.rs
index dee1d11..3b107bb 100644
--- a/src/backup_run.rs
+++ b/src/backup_run.rs
@@ -6,7 +6,9 @@ use crate::config::ClientConfig;
use crate::error::ObnamError;
use crate::fsentry::FilesystemEntry;
use crate::fsiter::{AnnotatedFsEntry, FsIterError, FsIterator};
-use crate::generation::{LocalGeneration, LocalGenerationError, NascentError, NascentGeneration};
+use crate::generation::{
+ GenId, LocalGeneration, LocalGenerationError, NascentError, NascentGeneration,
+};
use crate::policy::BackupPolicy;
use log::{info, warn};
use std::path::{Path, PathBuf};
@@ -72,7 +74,7 @@ impl<'a> BackupRun<'a> {
pub fn start(
&mut self,
- genid: Option<&str>,
+ genid: Option<&GenId>,
oldname: &Path,
) -> Result<LocalGeneration, ObnamError> {
match genid {
@@ -94,7 +96,7 @@ impl<'a> BackupRun<'a> {
fn fetch_previous_generation(
&self,
- genid: &str,
+ genid: &GenId,
oldname: &Path,
) -> Result<LocalGeneration, ObnamError> {
let progress = BackupProgress::download_generation(genid);