fix clipy warnings

This commit is contained in:
ad hoc 2022-05-25 15:07:52 +02:00
parent 74a1f88d88
commit 1647ca3c1f
No known key found for this signature in database
GPG key ID: 4F00A782990CC643
5 changed files with 10 additions and 19 deletions

View file

@ -35,9 +35,7 @@ where
}
}
async fn finish(&self, _: &Batch) {
()
}
async fn finish(&self, _: &Batch) {}
}
#[cfg(test)]

View file

@ -14,7 +14,5 @@ impl BatchHandler for EmptyBatchHandler {
batch
}
async fn finish(&self, _: &Batch) {
()
}
async fn finish(&self, _: &Batch) {}
}

View file

@ -13,10 +13,10 @@ where
I: IndexStore + Send + Sync + 'static,
{
fn accept(&self, batch: &Batch) -> bool {
match batch.content {
BatchContent::DocumentsAdditionBatch(_) | BatchContent::IndexUpdate(_) => true,
_ => false,
}
matches!(
batch.content,
BatchContent::DocumentsAdditionBatch(_) | BatchContent::IndexUpdate(_)
)
}
async fn process_batch(&self, mut batch: Batch) -> Batch {
@ -26,7 +26,7 @@ where
.process_document_addition_batch(std::mem::take(tasks))
.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) => {
task.events.push(TaskEvent::Succeded {
result: success,

View file

@ -6,10 +6,7 @@ pub struct SnapshotHandler;
#[async_trait::async_trait]
impl BatchHandler for SnapshotHandler {
fn accept(&self, batch: &Batch) -> bool {
match batch.content {
BatchContent::Snapshot(_) => true,
_ => false,
}
matches!(batch.content, BatchContent::Snapshot(_))
}
async fn process_batch(&self, batch: Batch) -> Batch {
@ -25,7 +22,5 @@ impl BatchHandler for SnapshotHandler {
Batch::empty()
}
async fn finish(&self, _: &Batch) {
()
}
async fn finish(&self, _: &Batch) {}
}