Disallow unreachable_pub (#4314)

This commit is contained in:
Jonathan Plasse 2023-05-12 00:00:00 +02:00 committed by GitHub
parent 97802e7466
commit c10a4535b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
444 changed files with 1376 additions and 1106 deletions

View file

@ -162,7 +162,7 @@ fn cache_key(
#[allow(dead_code)]
/// Initialize the cache at the specified `Path`.
pub fn init(path: &Path) -> Result<()> {
pub(crate) fn init(path: &Path) -> Result<()> {
// Create the cache directories.
fs::create_dir_all(path.join(content_dir()))?;
@ -197,7 +197,7 @@ fn del_sync(cache_dir: &Path, key: u64) -> Result<(), std::io::Error> {
}
/// Get a value from the cache.
pub fn get(
pub(crate) fn get(
path: &Path,
package: Option<&Path>,
metadata: &fs::Metadata,
@ -246,7 +246,7 @@ pub fn get(
}
/// Set a value in the cache.
pub fn set(
pub(crate) fn set(
path: &Path,
package: Option<&Path>,
metadata: &fs::Metadata,
@ -265,7 +265,12 @@ pub fn set(
}
/// Delete a value from the cache.
pub fn del(path: &Path, package: Option<&Path>, metadata: &fs::Metadata, settings: &AllSettings) {
pub(crate) fn del(
path: &Path,
package: Option<&Path>,
metadata: &fs::Metadata,
settings: &AllSettings,
) {
drop(del_sync(
&settings.cli.cache_dir,
cache_key(path, package, metadata, &settings.lib),