From 1ba46f8f776409d550495c37591a9718a4404451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mentine=20Urquizar?= Date: Tue, 27 Apr 2021 12:16:24 +0200 Subject: [PATCH] Disable clippy rule --- .../update_actor/update_store.rs | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/meilisearch-http/src/index_controller/update_actor/update_store.rs b/meilisearch-http/src/index_controller/update_actor/update_store.rs index 5cf00da34..f1895829b 100644 --- a/meilisearch-http/src/index_controller/update_actor/update_store.rs +++ b/meilisearch-http/src/index_controller/update_actor/update_store.rs @@ -13,16 +13,17 @@ use uuid::Uuid; use crate::helpers::EnvSizer; use crate::index_controller::updates::*; -type Beu64 = heed::zerocopy::U64; +#[allow(clippy::upper_case_acronyms)] +type BEU64 = heed::zerocopy::U64; #[derive(Clone)] pub struct UpdateStore { pub env: Env, - pending_meta: Database, SerdeJson>>, - pending: Database, SerdeJson>, - processed_meta: Database, SerdeJson>>, - failed_meta: Database, SerdeJson>>, - aborted_meta: Database, SerdeJson>>, + pending_meta: Database, SerdeJson>>, + pending: Database, SerdeJson>, + processed_meta: Database, SerdeJson>>, + failed_meta: Database, SerdeJson>>, + aborted_meta: Database, SerdeJson>>, processing: Arc>>>, notification_sender: mpsc::Sender<()>, /// A lock on the update loop. This is meant to prevent a snapshot to occur while an update is @@ -176,7 +177,7 @@ where // asking for the id and registering it so other update registering // will be forced to wait for a new write txn. let update_id = self.new_update_id(&wtxn)?; - let update_key = Beu64::new(update_id); + let update_key = BEU64::new(update_id); let meta = Enqueued::new(meta, update_id, index_uuid); self.pending_meta.put(&mut wtxn, &update_key, &meta)?; @@ -295,7 +296,7 @@ where /// Returns the update associated meta or `None` if the update doesn't exist. pub fn meta(&self, update_id: u64) -> heed::Result>> { let rtxn = self.env.read_txn()?; - let key = Beu64::new(update_id); + let key = BEU64::new(update_id); if let Some(ref meta) = *self.processing.read() { if meta.id() == update_id { @@ -331,7 +332,7 @@ where #[allow(dead_code)] pub fn abort_update(&self, update_id: u64) -> heed::Result>> { let mut wtxn = self.env.write_txn()?; - let key = Beu64::new(update_id); + let key = BEU64::new(update_id); // We cannot abort an update that is currently being processed. if self.pending_meta.first(&wtxn)?.map(|(key, _)| key.get()) == Some(update_id) { @@ -369,7 +370,7 @@ where } for (id, aborted) in &aborted_updates { - let key = Beu64::new(*id); + let key = BEU64::new(*id); self.aborted_meta.put(&mut wtxn, &key, &aborted)?; self.pending_meta.delete(&mut wtxn, &key)?; self.pending.delete(&mut wtxn, &key)?;