Skip to content

Replace Path::child with Path::join#666

Merged
crepererum merged 2 commits into
apache:mainfrom
Kinrany:push-smzntmymwozt
Mar 19, 2026
Merged

Replace Path::child with Path::join#666
crepererum merged 2 commits into
apache:mainfrom
Kinrany:push-smzntmymwozt

Conversation

@Kinrany

@Kinrany Kinrany commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #665.

What changes are included in this PR?

This is the version where we add a new method and immediately deprecate Path::child, making it easy for the users to migrate by inlining.

Proof of concept: shows one possible implementation, but likely needs minor changes at the very least.

Are there any user-facing changes?

Adds Path::join and deprecates Path::child.

No breaking changes yet, but implies that Path::child will be removed in the future.

Comment thread src/path/mod.rs

// two dir prefix matches
let needle = needle.child("baz%2Ftest");
let needle = needle.join("baz%2Ftest");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A test with an example of an unnecessary clone being removed.

@crepererum crepererum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense

@crepererum crepererum merged commit 7ded938 into apache:main Mar 19, 2026
9 checks passed
@Kinrany Kinrany deleted the push-smzntmymwozt branch March 19, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Path::join(Self, &PathPart) -> Self

2 participants