From 615a50c1087685e9042de636e98258cabc505751 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 3 Jun 2022 13:42:42 +0200 Subject: [PATCH] datastore: make unsafe functions only visible in their own crate Signed-off-by: Thomas Lamprecht --- pbs-datastore/src/datastore.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs index f88fe1ac..1c5f0077 100644 --- a/pbs-datastore/src/datastore.rs +++ b/pbs-datastore/src/datastore.rs @@ -65,7 +65,7 @@ pub struct DataStoreImpl { impl DataStoreImpl { // This one just panics on everything #[doc(hidden)] - pub unsafe fn new_test() -> Arc { + pub(crate) unsafe fn new_test() -> Arc { Arc::new(Self { chunk_store: Arc::new(unsafe { ChunkStore::panic_store() }), gc_mutex: Mutex::new(()), @@ -112,7 +112,7 @@ impl Drop for DataStore { impl DataStore { // This one just panics on everything #[doc(hidden)] - pub unsafe fn new_test() -> Arc { + pub(crate) unsafe fn new_test() -> Arc { Arc::new(Self { inner: unsafe { DataStoreImpl::new_test() }, operation: None, @@ -180,7 +180,8 @@ impl DataStore { /// /// # Safety /// See the safety section in `open_from_config` - pub unsafe fn open_path( + #[allow(dead_code)] + pub(crate) unsafe fn open_path( name: &str, path: impl AsRef, operation: Option, @@ -202,7 +203,7 @@ impl DataStore { /// chunkstore's process locker will close all locks from our process on the config.path, /// breaking guarantees we need to uphold for safe long backup + GC interaction on newer/older /// process instances (from package update). - pub unsafe fn open_from_config( + pub(crate) unsafe fn open_from_config( config: DataStoreConfig, operation: Option, ) -> Result, Error> {