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
+6 -3
View File
@@ -52,7 +52,7 @@ impl<'a> MatchCandidate for PathMatchCandidate<'a> {
}
fn candidate_chars(&self) -> impl Iterator<Item = char> {
self.path.as_str().chars()
self.path.as_unix_str().chars()
}
}
@@ -184,8 +184,11 @@ pub async fn match_path_sets<'a, Set: PathMatchCandidateSet<'a>>(
let candidates = candidate_set.candidates(start).take(end - start);
let worktree_id = candidate_set.id();
let mut prefix =
candidate_set.prefix().as_str().chars().collect::<Vec<_>>();
let mut prefix = candidate_set
.prefix()
.as_unix_str()
.chars()
.collect::<Vec<_>>();
if !candidate_set.root_is_file() && !prefix.is_empty() {
prefix.push('/');
}