Skip to content

Commit

Permalink
Replace \ to /
Browse files Browse the repository at this point in the history
  • Loading branch information
hauserx committed Dec 2, 2024
1 parent 477d87e commit 76c0f31
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions starlark_lsp/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1471,10 +1471,10 @@ mod tests {
Url::from_file_path(PathBuf::from("/tmp").join(rel_path)).unwrap()
}

// Converts PathBuf to string that can be used in starlark load statements.
// Performs simple string quoting by replacing \ with \\ (for windows paths).
// Converts PathBuf to string that can be used in starlark load statements within "" quotes.
// Replaces \ with / (for Windows paths).
fn path_buf_to_load_string(p: &PathBuf) -> String {
p.to_str().unwrap().replace("\\", "\\\\")
p.to_str().unwrap().replace('\\', "/")
}

fn uri_to_load_string(uri: &Url) -> String {
Expand Down

0 comments on commit 76c0f31

Please sign in to comment.