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
+3 -3
View File
@@ -419,7 +419,7 @@ impl SshRemoteConnection {
version_str
);
let dst_path =
paths::remote_server_dir_relative().join(RelPath::new(&binary_name).unwrap());
paths::remote_server_dir_relative().join(RelPath::unix(&binary_name).unwrap());
#[cfg(debug_assertions)]
if let Some(remote_server_path) =
@@ -427,7 +427,7 @@ impl SshRemoteConnection {
.await?
{
let tmp_path = paths::remote_server_dir_relative().join(
RelPath::new(&format!(
RelPath::unix(&format!(
"download-{}-{}",
std::process::id(),
remote_server_path.file_name().unwrap().to_string_lossy()
@@ -462,7 +462,7 @@ impl SshRemoteConnection {
})??;
let tmp_path_gz = remote_server_dir_relative().join(
RelPath::new(&format!(
RelPath::unix(&format!(
"{}-download-{}.gz",
binary_name,
std::process::id()
+3 -3
View File
@@ -142,7 +142,7 @@ impl WslRemoteConnection {
);
let dst_path =
paths::remote_wsl_server_dir_relative().join(RelPath::new(&binary_name).unwrap());
paths::remote_wsl_server_dir_relative().join(RelPath::unix(&binary_name).unwrap());
if let Some(parent) = dst_path.parent() {
self.run_wsl_command("mkdir", &["-p", &parent.display(PathStyle::Posix)])
@@ -155,7 +155,7 @@ impl WslRemoteConnection {
super::build_remote_server_from_source(&self.platform, delegate.as_ref(), cx).await?
{
let tmp_path = paths::remote_wsl_server_dir_relative().join(
&RelPath::new(&format!(
&RelPath::unix(&format!(
"download-{}-{}",
std::process::id(),
remote_server_path.file_name().unwrap().to_string_lossy()
@@ -193,7 +193,7 @@ impl WslRemoteConnection {
dst_path.display(PathStyle::Posix),
std::process::id()
);
let tmp_path = RelPath::new(&tmp_path).unwrap();
let tmp_path = RelPath::unix(&tmp_path).unwrap();
self.upload_file(&src_path, &tmp_path, delegate, cx).await?;
self.extract_and_install(&tmp_path, &dst_path, delegate, cx)