From 42e2ac4ec14682e8dbc95cf333135f045d2909b5 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 5 Feb 2025 20:39:43 +0100 Subject: [PATCH] remove async_trait for TableRepair --- src/garage/repair/online.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/garage/repair/online.rs b/src/garage/repair/online.rs index 2c5227d2..a74d37f8 100644 --- a/src/garage/repair/online.rs +++ b/src/garage/repair/online.rs @@ -1,5 +1,6 @@ use std::sync::Arc; use std::time::Duration; +use std::future::Future; use async_trait::async_trait; use tokio::sync::watch; @@ -93,17 +94,16 @@ pub async fn launch_online_repair( // ---- -#[async_trait] trait TableRepair: Send + Sync + 'static { type T: TableSchema; fn table(garage: &Garage) -> &Table; - async fn process( + fn process( &mut self, garage: &Garage, entry: <::T as TableSchema>::E, - ) -> Result; + ) -> impl Future> + Send; } struct TableRepairWorker { @@ -174,7 +174,6 @@ impl Worker for TableRepairWorker { struct RepairVersions; -#[async_trait] impl TableRepair for RepairVersions { type T = VersionTable; @@ -221,7 +220,6 @@ impl TableRepair for RepairVersions { struct RepairBlockRefs; -#[async_trait] impl TableRepair for RepairBlockRefs { type T = BlockRefTable; @@ -257,7 +255,6 @@ impl TableRepair for RepairBlockRefs { struct RepairMpu; -#[async_trait] impl TableRepair for RepairMpu { type T = MultipartUploadTable;