Skip to content

Commit

Permalink
feat: make find_project_manifest argument generic
Browse files Browse the repository at this point in the history
The find_project_manifest() only needs a reference to current_dir, so
relax the type to make it easier for callers to use.
  • Loading branch information
blmaier committed Dec 16, 2024
1 parent 2e8ca9b commit cb5c837
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/project/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PathBuf> {
pub(crate) fn find_project_manifest(current_dir: impl AsRef<Path>) -> Option<PathBuf> {
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() {
Expand Down

0 comments on commit cb5c837

Please sign in to comment.