From 492fc086f0a37fffb7d3db34880820c46115434f Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Sun, 12 Nov 2023 21:53:11 +0100 Subject: [PATCH] cargo fmt --- index-scheduler/src/batch.rs | 7 ++++--- index-scheduler/src/lib.rs | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/index-scheduler/src/batch.rs b/index-scheduler/src/batch.rs index 264afadae..96cb85562 100644 --- a/index-scheduler/src/batch.rs +++ b/index-scheduler/src/batch.rs @@ -924,7 +924,8 @@ impl IndexScheduler { }; // the index operation can take a long time, so save this handle to make it available tothe search for the duration of the tick - *self.currently_updating_index.write().unwrap() = Some((index_uid.clone(), index.clone())); + *self.currently_updating_index.write().unwrap() = + Some((index_uid.clone(), index.clone())); let mut index_wtxn = index.write_txn()?; let tasks = self.apply_index_operation(&mut index_wtxn, &index, op)?; @@ -963,8 +964,8 @@ impl IndexScheduler { let rtxn = self.env.read_txn()?; let index = self.index_mapper.index(&rtxn, &index_uid)?; // the index update can take a long time, so save this handle to make it available tothe search for the duration of the tick - *self.currently_updating_index.write().unwrap() = Some((index_uid.clone(), index.clone())); - + *self.currently_updating_index.write().unwrap() = + Some((index_uid.clone(), index.clone())); if let Some(primary_key) = primary_key.clone() { let mut index_wtxn = index.write_txn()?; diff --git a/index-scheduler/src/lib.rs b/index-scheduler/src/lib.rs index 0194bdb9d..95902aa15 100644 --- a/index-scheduler/src/lib.rs +++ b/index-scheduler/src/lib.rs @@ -658,9 +658,11 @@ impl IndexScheduler { /// If you need to fetch information from or perform an action on all indexes, /// see the `try_for_each_index` function. pub fn index(&self, name: &str) -> Result { - if let Some((current_name, current_index)) = self.currently_updating_index.read().unwrap().as_ref() { + if let Some((current_name, current_index)) = + self.currently_updating_index.read().unwrap().as_ref() + { if current_name == name { - return Ok(current_index.clone()) + return Ok(current_index.clone()); } } let rtxn = self.env.read_txn()?;