Skip to content

Commit

Permalink
chore: the arc is unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
killme2008 committed Oct 8, 2023
1 parent 3dc97d8 commit 30349a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/object-store/src/layers/lru_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ impl<I: Accessor, C: Accessor + Clone> Layer<I> for LruCacheLayer<C> {

fn layer(&self, inner: I) -> Self::LayeredAccessor {
LruCacheAccessor {
inner: Arc::new(inner),
inner,
read_cache: self.read_cache.clone(),
}
}
}

#[derive(Debug)]
pub struct LruCacheAccessor<I, C: Clone> {
inner: Arc<I>,
inner: I,
read_cache: ReadCache<C>,
}

Expand Down
4 changes: 2 additions & 2 deletions src/object-store/src/layers/lru_cache/read_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ impl<C: Accessor + Clone> ReadCache<C> {
/// and cache the result locally.
pub(crate) async fn read<I>(
&self,
inner: &Arc<I>,
inner: &I,
path: &str,
args: OpRead,
) -> Result<(RpRead, Box<dyn Read>)>
Expand Down Expand Up @@ -223,7 +223,7 @@ impl<C: Accessor + Clone> ReadCache<C> {
/// Read the file from remote storage. If success, write the content into local cache.
async fn read_remote<I>(
&self,
inner: &Arc<I>,
inner: &I,
read_key: &str,
path: &str,
args: OpRead,
Expand Down

0 comments on commit 30349a2

Please sign in to comment.