make iter_historic_layers return references

This commit is contained in:
John Spray
2024-07-26 14:21:26 +00:00
parent 97416d5e6c
commit 826e604772
3 changed files with 4 additions and 4 deletions

View File

@@ -543,7 +543,7 @@ impl LayerMap {
true
}
pub fn iter_historic_layers(&self) -> impl '_ + Iterator<Item = Arc<PersistentLayerDesc>> {
pub fn iter_historic_layers(&self) -> impl '_ + Iterator<Item = &Arc<PersistentLayerDesc>> {
self.historic.iter()
}

View File

@@ -499,14 +499,14 @@ impl<Value: Clone> BufferedHistoricLayerCoverage<Value> {
}
/// Iterate all the layers
pub fn iter(&self) -> impl '_ + Iterator<Item = Value> {
pub fn iter(&self) -> impl '_ + Iterator<Item = &Value> {
// NOTE we can actually perform this without rebuilding,
// but it's not necessary for now.
if !self.buffer.is_empty() {
panic!("rebuild pls")
}
self.layers.values().cloned()
self.layers.values()
}
/// Return a reference to a queryable map, assuming all updates

View File

@@ -1596,7 +1596,7 @@ impl CompactionJobExecutor for TimelineAdaptor {
.filter(|l| {
overlaps_with(&l.lsn_range, lsn_range) && overlaps_with(&l.key_range, key_range)
})
.map(OwnArc)
.map(|l| OwnArc(l.clone()))
.collect();
Ok(result)
}