Use AsRef<Path> instead of PathBuf for parameters (#23560)

This commit is contained in:
Brooks Prumo
2022-03-09 16:08:33 -06:00
committed by GitHub
parent fb974489a5
commit 9bbccbe27c
4 changed files with 10 additions and 12 deletions

View File

@ -1053,12 +1053,12 @@ pub fn path_to_file_name_str(path: &Path) -> Result<&str> {
/// Build the full snapshot archive path from its components: the snapshot archives directory, the
/// snapshot slot, the accounts hash, and the archive format.
pub fn build_full_snapshot_archive_path(
snapshot_archives_dir: PathBuf,
snapshot_archives_dir: impl AsRef<Path>,
slot: Slot,
hash: &Hash,
archive_format: ArchiveFormat,
) -> PathBuf {
snapshot_archives_dir.join(format!(
snapshot_archives_dir.as_ref().join(format!(
"snapshot-{}-{}.{}",
slot,
hash,
@ -1070,13 +1070,13 @@ pub fn build_full_snapshot_archive_path(
/// directory, the snapshot base slot, the snapshot slot, the accounts hash, and the archive
/// format.
pub fn build_incremental_snapshot_archive_path(
snapshot_archives_dir: PathBuf,
snapshot_archives_dir: impl AsRef<Path>,
base_slot: Slot,
slot: Slot,
hash: &Hash,
archive_format: ArchiveFormat,
) -> PathBuf {
snapshot_archives_dir.join(format!(
snapshot_archives_dir.as_ref().join(format!(
"incremental-snapshot-{}-{}-{}.{}",
base_slot,
slot,