diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-12-31 15:29:19 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-12-31 15:29:19 +0000 |
commit | a7336cfa6cb3f5de69c994a5e61868d49756b1ad (patch) | |
tree | 9388040e96f3a42679860f70c4540aedceff329d /src/genlist.rs | |
parent | 85d0ce236677c35c85d76bfc345e36d29f585390 (diff) | |
parent | 6171b3c2eb8ec9a7734e8ce00c81999500b5fbe6 (diff) | |
download | obnam2-a7336cfa6cb3f5de69c994a5e61868d49756b1ad.tar.gz |
Merge branch 'inc' into 'main'
feat: incremental backup
Closes #8
See merge request larswirzenius/obnam!53
Diffstat (limited to 'src/genlist.rs')
-rw-r--r-- | src/genlist.rs | 9 |
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 + } } } |