mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-22 18:17:39 +08:00
fix clipy warnings
This commit is contained in:
parent
74a1f88d88
commit
1647ca3c1f
@ -35,9 +35,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn finish(&self, _: &Batch) {
|
async fn finish(&self, _: &Batch) {}
|
||||||
()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
@ -14,7 +14,5 @@ impl BatchHandler for EmptyBatchHandler {
|
|||||||
batch
|
batch
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn finish(&self, _: &Batch) {
|
async fn finish(&self, _: &Batch) {}
|
||||||
()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -13,10 +13,10 @@ where
|
|||||||
I: IndexStore + Send + Sync + 'static,
|
I: IndexStore + Send + Sync + 'static,
|
||||||
{
|
{
|
||||||
fn accept(&self, batch: &Batch) -> bool {
|
fn accept(&self, batch: &Batch) -> bool {
|
||||||
match batch.content {
|
matches!(
|
||||||
BatchContent::DocumentsAdditionBatch(_) | BatchContent::IndexUpdate(_) => true,
|
batch.content,
|
||||||
_ => false,
|
BatchContent::DocumentsAdditionBatch(_) | BatchContent::IndexUpdate(_)
|
||||||
}
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn process_batch(&self, mut batch: Batch) -> Batch {
|
async fn process_batch(&self, mut batch: Batch) -> Batch {
|
||||||
@ -26,7 +26,7 @@ where
|
|||||||
.process_document_addition_batch(std::mem::take(tasks))
|
.process_document_addition_batch(std::mem::take(tasks))
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
BatchContent::IndexUpdate(ref mut task) => match self.process_task(&task).await {
|
BatchContent::IndexUpdate(ref mut task) => match self.process_task(task).await {
|
||||||
Ok(success) => {
|
Ok(success) => {
|
||||||
task.events.push(TaskEvent::Succeded {
|
task.events.push(TaskEvent::Succeded {
|
||||||
result: success,
|
result: success,
|
||||||
|
@ -6,10 +6,7 @@ pub struct SnapshotHandler;
|
|||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
impl BatchHandler for SnapshotHandler {
|
impl BatchHandler for SnapshotHandler {
|
||||||
fn accept(&self, batch: &Batch) -> bool {
|
fn accept(&self, batch: &Batch) -> bool {
|
||||||
match batch.content {
|
matches!(batch.content, BatchContent::Snapshot(_))
|
||||||
BatchContent::Snapshot(_) => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn process_batch(&self, batch: Batch) -> Batch {
|
async fn process_batch(&self, batch: Batch) -> Batch {
|
||||||
@ -25,7 +22,5 @@ impl BatchHandler for SnapshotHandler {
|
|||||||
Batch::empty()
|
Batch::empty()
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn finish(&self, _: &Batch) {
|
async fn finish(&self, _: &Batch) {}
|
||||||
()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ impl Store {
|
|||||||
self.tasks.put(txn, &BEU64::new(task.id), task)?;
|
self.tasks.put(txn, &BEU64::new(task.id), task)?;
|
||||||
// only add the task to the indexes index if it has an index_uid
|
// only add the task to the indexes index if it has an index_uid
|
||||||
if let Some(ref index_uid) = task.index_uid {
|
if let Some(ref index_uid) = task.index_uid {
|
||||||
self.uids_task_ids.put(txn, &(&index_uid, task.id), &())?;
|
self.uids_task_ids.put(txn, &(index_uid, task.id), &())?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
Reference in New Issue
Block a user