summaryrefslogtreecommitdiff
path: root/src/genlist.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-12-31 15:32:51 +0200
committerLars Wirzenius <liw@liw.fi>2020-12-31 17:25:42 +0200
commit6171b3c2eb8ec9a7734e8ce00c81999500b5fbe6 (patch)
tree9388040e96f3a42679860f70c4540aedceff329d /src/genlist.rs
parent85d0ce236677c35c85d76bfc345e36d29f585390 (diff)
downloadobnam2-6171b3c2eb8ec9a7734e8ce00c81999500b5fbe6.tar.gz
feat: incremental backup
This uses the previous, latest generation as a guideline to see what is new or changed.
Diffstat (limited to 'src/genlist.rs')
-rw-r--r--src/genlist.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/genlist.rs b/src/genlist.rs
index 9c511f2..10c614e 100644
--- a/src/genlist.rs
+++ b/src/genlist.rs
@@ -18,11 +18,9 @@ impl GenerationList {
pub fn resolve(&self, genref: &str) -> Option<String> {
let gen = if self.list.is_empty() {
- eprintln!("genlist: empty");
None
} else if genref == "latest" {
let i = self.list.len() - 1;
- eprintln!("genlist: latest={} of {}", i, self.list.len());
Some(self.list[i].clone())
} else {
let genref: ChunkId = genref.parse().unwrap();
@@ -31,18 +29,15 @@ impl GenerationList {
.filter(|gen| gen.id() == genref)
.map(|gen| gen.clone())
.collect();
- eprintln!("genlist: hits={}", hits.len());
if hits.len() == 1 {
Some(hits[0].clone())
} else {
None
}
};
- let ret = match gen {
+ match gen {
None => None,
Some(gen) => Some(gen.id().to_string()),
- };
- eprintln!("genlist: return {:?}", ret);
- ret
+ }
}
}