From db377fd1e33dd44f8284c5f20609b0af52c302cd Mon Sep 17 00:00:00 2001 From: Duarte Nunes Date: Thu, 15 Jul 2021 03:18:46 -0300 Subject: [PATCH] Allow cloning the Cache and Env (#533) --- src/db_options.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/db_options.rs b/src/db_options.rs index db0f7d7..8b0c568 100644 --- a/src/db_options.rs +++ b/src/db_options.rs @@ -48,6 +48,7 @@ impl Drop for CacheWrapper { } } +#[derive(Clone)] pub struct Cache(pub(crate) Arc); impl Cache { @@ -77,10 +78,6 @@ impl Cache { ffi::rocksdb_cache_set_capacity(self.0.inner, capacity); } } - - fn clone(&self) -> Self { - Self(self.0.clone()) - } } /// An Env is an interface used by the rocksdb implementation to access @@ -93,6 +90,7 @@ impl Cache { /// /// Note: currently, C API behinds C++ API for various settings. /// See also: `rocksdb/include/env.h` +#[derive(Clone)] pub struct Env(Arc); struct EnvWrapper {