summaryrefslogtreecommitdiff
path: root/src/genlist.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-08-01 20:50:58 +0300
committerLars Wirzenius <liw@liw.fi>2021-08-01 20:55:04 +0300
commit1962cdaebc71bec28861635784e0b41deac98060 (patch)
treeb25ed37fcfb2f8805a5b298b5ba09b80922a3c11 /src/genlist.rs
parent2bc07b176bcf63f94bf6f1cca0ade2505958a15d (diff)
downloadobnam2-1962cdaebc71bec28861635784e0b41deac98060.tar.gz
refactor: use a struct for GenId
This means a ChunkId can't be used instead. Sponsored-by: author
Diffstat (limited to 'src/genlist.rs')
-rw-r--r--src/genlist.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/genlist.rs b/src/genlist.rs
index edc405a..a81a997 100644
--- a/src/genlist.rs
+++ b/src/genlist.rs
@@ -29,10 +29,10 @@ impl GenerationList {
let i = self.list.len() - 1;
Some(self.list[i].clone())
} else {
- let genref: ChunkId = genref.parse().unwrap();
+ let genref = GenId::from_chunk_id(genref.parse().unwrap());
let hits: Vec<FinishedGeneration> = self
.iter()
- .filter(|gen| gen.id() == genref)
+ .filter(|gen| gen.id().as_chunk_id() == genref.as_chunk_id())
.cloned()
.collect();
if hits.len() == 1 {
@@ -45,7 +45,7 @@ impl GenerationList {
None => Err(GenerationListError::UnknownGeneration(ChunkId::recreate(
genref,
))),
- Some(gen) => Ok(gen.id()),
+ Some(gen) => Ok(gen.id().clone()),
}
}
}