From 7faa9a22f6d398496fe6fc07028763a55c9466e1 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Tue, 7 Mar 2023 14:00:54 +0100 Subject: [PATCH] Pass IndexStat by ref in store_stats_of --- index-scheduler/src/batch.rs | 4 ++-- index-scheduler/src/index_mapper/mod.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/index-scheduler/src/batch.rs b/index-scheduler/src/batch.rs index 41b5793b1..8d0e1ac3f 100644 --- a/index-scheduler/src/batch.rs +++ b/index-scheduler/src/batch.rs @@ -850,7 +850,7 @@ impl IndexScheduler { let index_rtxn = index.read_txn()?; let stats = crate::index_mapper::IndexStats::new(&index, &index_rtxn)?; let mut wtxn = self.env.write_txn()?; - self.index_mapper.store_stats_of(&mut wtxn, &index_uid, stats)?; + self.index_mapper.store_stats_of(&mut wtxn, &index_uid, &stats)?; wtxn.commit()?; Ok(()) }(); @@ -905,7 +905,7 @@ impl IndexScheduler { let mut wtxn = self.env.write_txn()?; let index_rtxn = index.read_txn()?; let stats = crate::index_mapper::IndexStats::new(&index, &index_rtxn)?; - self.index_mapper.store_stats_of(&mut wtxn, &index_uid, stats)?; + self.index_mapper.store_stats_of(&mut wtxn, &index_uid, &stats)?; wtxn.commit()?; Ok(()) }(); diff --git a/index-scheduler/src/index_mapper/mod.rs b/index-scheduler/src/index_mapper/mod.rs index 174f4f9a3..2bf6f46ad 100644 --- a/index-scheduler/src/index_mapper/mod.rs +++ b/index-scheduler/src/index_mapper/mod.rs @@ -432,14 +432,14 @@ impl IndexMapper { &self, wtxn: &mut RwTxn, index_uid: &str, - stats: IndexStats, + stats: &IndexStats, ) -> Result<()> { let uuid = self .index_mapping .get(wtxn, index_uid)? .ok_or_else(|| Error::IndexNotFound(index_uid.to_string()))?; - self.index_stats.put(wtxn, &uuid, &stats)?; + self.index_stats.put(wtxn, &uuid, stats)?; Ok(()) }