From 30349a2d896615ede595ecd762e59df3f39da41a Mon Sep 17 00:00:00 2001 From: Dennis Zhuang Date: Sun, 8 Oct 2023 11:14:21 +0800 Subject: [PATCH] chore: the arc is unnecessary --- src/object-store/src/layers/lru_cache.rs | 4 ++-- src/object-store/src/layers/lru_cache/read_cache.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/object-store/src/layers/lru_cache.rs b/src/object-store/src/layers/lru_cache.rs index f43468dcf2ef..c0958638b90d 100644 --- a/src/object-store/src/layers/lru_cache.rs +++ b/src/object-store/src/layers/lru_cache.rs @@ -62,7 +62,7 @@ impl Layer for LruCacheLayer { fn layer(&self, inner: I) -> Self::LayeredAccessor { LruCacheAccessor { - inner: Arc::new(inner), + inner, read_cache: self.read_cache.clone(), } } @@ -70,7 +70,7 @@ impl Layer for LruCacheLayer { #[derive(Debug)] pub struct LruCacheAccessor { - inner: Arc, + inner: I, read_cache: ReadCache, } diff --git a/src/object-store/src/layers/lru_cache/read_cache.rs b/src/object-store/src/layers/lru_cache/read_cache.rs index ca0252224039..586465b996ac 100644 --- a/src/object-store/src/layers/lru_cache/read_cache.rs +++ b/src/object-store/src/layers/lru_cache/read_cache.rs @@ -172,7 +172,7 @@ impl ReadCache { /// and cache the result locally. pub(crate) async fn read( &self, - inner: &Arc, + inner: &I, path: &str, args: OpRead, ) -> Result<(RpRead, Box)> @@ -223,7 +223,7 @@ impl ReadCache { /// Read the file from remote storage. If success, write the content into local cache. async fn read_remote( &self, - inner: &Arc, + inner: &I, read_key: &str, path: &str, args: OpRead,