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
@@ -425,7 +425,7 @@ impl ExtensionImports for WasmState {
let location = location.as_ref().and_then(|location| {
Some(::settings::SettingsLocation {
worktree_id: WorktreeId::from_proto(location.worktree_id),
path: RelPath::new(&location.path).ok()?,
path: RelPath::unix(&location.path).ok()?,
})
});
@@ -564,7 +564,7 @@ impl HostWorktree for WasmState {
) -> wasmtime::Result<Result<String, String>> {
let delegate = self.table.get(&delegate)?;
Ok(delegate
.read_text_file(RelPath::new(&path)?)
.read_text_file(RelPath::unix(&path)?)
.await
.map_err(|error| error.to_string()))
}
@@ -917,7 +917,7 @@ impl ExtensionImports for WasmState {
let location = location.as_ref().and_then(|location| {
Some(::settings::SettingsLocation {
worktree_id: WorktreeId::from_proto(location.worktree_id),
path: RelPath::new(&location.path).ok()?,
path: RelPath::unix(&location.path).ok()?,
})
});