From cb5c837a3faf3ce294801b23404a5db8058e444d Mon Sep 17 00:00:00 2001 From: Brandon Maier Date: Mon, 16 Dec 2024 08:30:11 -0600 Subject: [PATCH] feat: make find_project_manifest argument generic The find_project_manifest() only needs a reference to current_dir, so relax the type to make it easier for callers to use. --- src/project/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/project/mod.rs b/src/project/mod.rs index a27ef18c0..ad95c5244 100644 --- a/src/project/mod.rs +++ b/src/project/mod.rs @@ -1030,10 +1030,10 @@ impl<'source> HasManifestRef<'source> for &'source Project { /// Iterates over the current directory and all its parent directories and /// returns the manifest path in the first directory path that contains the /// [`consts::PROJECT_MANIFEST`] or [`consts::PYPROJECT_MANIFEST`]. -pub(crate) fn find_project_manifest(current_dir: PathBuf) -> Option { +pub(crate) fn find_project_manifest(current_dir: impl AsRef) -> Option { let manifests = [consts::PROJECT_MANIFEST, consts::PYPROJECT_MANIFEST]; - for dir in current_dir.ancestors() { + for dir in current_dir.as_ref().ancestors() { for manifest in &manifests { let path = dir.join(manifest); if !path.is_file() {