diff --git a/src/common/meta/src/kv_backend/chroot.rs b/src/common/meta/src/kv_backend/chroot.rs index 19bc95b024b5..673e8c6e90ba 100644 --- a/src/common/meta/src/kv_backend/chroot.rs +++ b/src/common/meta/src/kv_backend/chroot.rs @@ -15,6 +15,7 @@ use std::any::Any; use std::sync::Arc; +use crate::error::Error; use crate::kv_backend::txn::{Txn, TxnOp, TxnOpResponse, TxnResponse}; use crate::kv_backend::{KvBackend, KvBackendRef, TxnService}; use crate::rpc::store::{ @@ -29,7 +30,7 @@ pub struct ChrootKvBackend { inner: B, } -impl ChrootKvBackend { +impl + 'static> ChrootKvBackend { pub fn new(root: Vec, inner: B) -> KvBackendRef { debug_assert!(!root.is_empty()); Arc::new(ChrootKvBackend { root, inner }) @@ -37,8 +38,8 @@ impl ChrootKvBackend { } #[async_trait::async_trait] -impl TxnService for ChrootKvBackend { - type Error = B::Error; +impl> TxnService for ChrootKvBackend { + type Error = Error; async fn txn(&self, txn: Txn) -> Result { let txn = txn_prepend_root(&self.root, txn); @@ -48,7 +49,7 @@ impl TxnService for ChrootKvBackend { } #[async_trait::async_trait] -impl KvBackend for ChrootKvBackend { +impl> KvBackend for ChrootKvBackend { fn name(&self) -> &str { self.inner.name() }