From 7879189c6b6e1311a17831e9c0d3b69a9fcc458c Mon Sep 17 00:00:00 2001 From: Tamo Date: Wed, 7 Sep 2022 20:38:57 +0200 Subject: [PATCH] make the project compile again --- index-scheduler/src/index/index.rs | 4 ++-- index-scheduler/src/lib.rs | 4 ++-- index-scheduler/src/utils.rs | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/index-scheduler/src/index/index.rs b/index-scheduler/src/index/index.rs index fbb76bbdf..36f195abe 100644 --- a/index-scheduler/src/index/index.rs +++ b/index-scheduler/src/index/index.rs @@ -124,8 +124,8 @@ impl Index { self.settings_txn(&txn) } - pub fn name(&self) -> String { - self.name + pub fn name(&self) -> &str { + &self.name } pub fn settings_txn(&self, txn: &RoTxn) -> Result> { diff --git a/index-scheduler/src/lib.rs b/index-scheduler/src/lib.rs index d2685c49d..a8605ca3d 100644 --- a/index-scheduler/src/lib.rs +++ b/index-scheduler/src/lib.rs @@ -215,7 +215,7 @@ impl IndexScheduler { continue; } }; - let batch = match self.get_next_batch(&wtxn) { + let mut batch = match self.get_next_batch(&wtxn) { Ok(batch) => batch, Err(e) => { log::error!("{}", e); @@ -232,7 +232,7 @@ impl IndexScheduler { fn process_batch(&self, wtxn: &mut RwTxn, batch: &mut Batch) -> Result<()> { match batch { - Batch::One(task) => match task.kind { + Batch::One(task) => match &task.kind { KindWithContent::ClearAllDocuments { index_name } => { self.index(&index_name)?.clear_documents()?; } diff --git a/index-scheduler/src/utils.rs b/index-scheduler/src/utils.rs index c278c93c1..0efcdba2d 100644 --- a/index-scheduler/src/utils.rs +++ b/index-scheduler/src/utils.rs @@ -50,22 +50,22 @@ impl IndexScheduler { .ok_or(Error::CorruptedTaskQueue)?; if old_task.status != task.status { - self.update_status(wtxn, old_task.status, |bitmap| { + self.update_status(wtxn, old_task.status, |mut bitmap| { bitmap.remove(task.uid); bitmap })?; - self.update_status(wtxn, task.status, |bitmap| { + self.update_status(wtxn, task.status, |mut bitmap| { bitmap.insert(task.uid); bitmap })?; } if old_task.kind.as_kind() != task.kind.as_kind() { - self.update_kind(wtxn, old_task.kind.as_kind(), |bitmap| { + self.update_kind(wtxn, old_task.kind.as_kind(), |mut bitmap| { bitmap.remove(task.uid); bitmap })?; - self.update_kind(wtxn, task.kind.as_kind(), |bitmap| { + self.update_kind(wtxn, task.kind.as_kind(), |mut bitmap| { bitmap.insert(task.uid); bitmap })?;