clean up pub crate (#33214)

Co-authored-by: HaoranYi <haoran.yi@solana.com>
This commit is contained in:
HaoranYi 2023-09-11 19:28:26 -05:00 committed by GitHub
parent 09936aac0e
commit 3cd3994939
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -196,7 +196,7 @@ impl CacheHashDataFile {
} }
} }
pub struct CacheHashData { pub(crate) struct CacheHashData {
cache_dir: PathBuf, cache_dir: PathBuf,
pre_existing_cache_files: Arc<Mutex<HashSet<PathBuf>>>, pre_existing_cache_files: Arc<Mutex<HashSet<PathBuf>>>,
should_delete_old_cache_files_on_drop: bool, should_delete_old_cache_files_on_drop: bool,
@ -213,7 +213,10 @@ impl Drop for CacheHashData {
} }
impl CacheHashData { impl CacheHashData {
pub fn new(cache_dir: PathBuf, should_delete_old_cache_files_on_drop: bool) -> CacheHashData { pub(crate) fn new(
cache_dir: PathBuf,
should_delete_old_cache_files_on_drop: bool,
) -> CacheHashData {
std::fs::create_dir_all(&cache_dir).unwrap_or_else(|err| { std::fs::create_dir_all(&cache_dir).unwrap_or_else(|err| {
panic!("error creating cache dir {}: {err}", cache_dir.display()) panic!("error creating cache dir {}: {err}", cache_dir.display())
}); });
@ -292,7 +295,7 @@ impl CacheHashData {
} }
/// save 'data' to 'file_name' /// save 'data' to 'file_name'
pub fn save( pub(crate) fn save(
&self, &self,
file_name: impl AsRef<Path>, file_name: impl AsRef<Path>,
data: &SavedTypeSlice, data: &SavedTypeSlice,