Clean up RelPath API (#38912)

Consolidate constructors and accessors.

Release Notes:

- N/A

---------

Co-authored-by: Cole Miller <cole@zed.dev>
This commit is contained in:
Max Brunsfeld
2025-09-25 14:42:32 -07:00
committed by GitHub
co-authored by Cole Miller
parent 301e976465
commit 495a7b0a84
70 changed files with 483 additions and 408 deletions
+2 -2
View File
@@ -55,7 +55,7 @@ impl ManifestProvider for PyprojectTomlManifestProvider {
}: ManifestQuery,
) -> Option<Arc<RelPath>> {
for path in path.ancestors().take(depth) {
let p = path.join(RelPath::new("pyproject.toml").unwrap());
let p = path.join(RelPath::unix("pyproject.toml").unwrap());
if delegate.exists(&p, Some(false)) {
return Some(path.into());
}
@@ -1030,7 +1030,7 @@ impl ToolchainLister for PythonToolchainProvider {
config.workspace_directories = Some(
subroot_relative_path
.ancestors()
.map(|ancestor| worktree_root.join(ancestor))
.map(|ancestor| worktree_root.join(ancestor.as_std_path()))
.collect(),
);
for locator in locators.iter() {