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
+4 -4
View File
@@ -228,7 +228,7 @@ impl TaskSourceKind {
id_base,
directory_in_worktree,
} => {
format!("{id_base}_{id}_{}", directory_in_worktree.as_str())
format!("{id_base}_{id}_{}", directory_in_worktree.as_unix_str())
}
Self::Language { name } => format!("language_{name}"),
Self::Lsp {
@@ -1182,7 +1182,7 @@ mod tests {
let worktree_id = WorktreeId::from_usize(0);
let local_worktree_location = SettingsLocation {
worktree_id,
path: RelPath::new("foo").unwrap(),
path: rel_path("foo"),
};
inventory.update(cx, |inventory, _| {
inventory
@@ -1476,7 +1476,7 @@ mod tests {
.update_file_based_tasks(
TaskSettingsLocation::Worktree(SettingsLocation {
worktree_id: worktree_1,
path: RelPath::new(".zed").unwrap(),
path: rel_path(".zed"),
}),
Some(&mock_tasks_from_names(
worktree_1_tasks.iter().map(|(_, name)| name.as_str()),
@@ -1487,7 +1487,7 @@ mod tests {
.update_file_based_tasks(
TaskSettingsLocation::Worktree(SettingsLocation {
worktree_id: worktree_2,
path: RelPath::new(".zed").unwrap(),
path: rel_path(".zed"),
}),
Some(&mock_tasks_from_names(
worktree_2_tasks.iter().map(|(_, name)| name.as_str()),