Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

debugger: Fix panic at non-UTF-8 character in paths on Linux (#49103)

cuie4f2492099cf
diff --git a/crates/project/src/debugger/breakpoint_store.rs b/crates/project/src/debugger/breakpoint_store.rs
index 7da8a180887..d5487818915 100644
--- a/crates/project/src/debugger/breakpoint_store.rs
+++ b/crates/project/src/debugger/breakpoint_store.rs
@@ -316,7 +316,7 @@ impl BreakpointStore {
for (path, breakpoint_set) in &self.breakpoints {
let _ = client.send(proto::BreakpointsForFile {
project_id: *project_id,
- path: path.to_str().map(ToOwned::to_owned).unwrap(),
+ path: path.to_string_lossy().into_owned(),
breakpoints: breakpoint_set
.breakpoints
.iter()
@@ -553,7 +553,7 @@ impl BreakpointStore {
{
cx.background_spawn(remote.upstream_client.request(proto::ToggleBreakpoint {
project_id: remote.upstream_project_id,
- path: abs_path.to_str().map(ToOwned::to_owned).unwrap(),
+ path: abs_path.to_string_lossy().into_owned(),
breakpoint: Some(breakpoint),
}))
.detach();
@@ -577,7 +577,7 @@ impl BreakpointStore {
let _ = client.send(proto::BreakpointsForFile {
project_id: *project_id,
- path: abs_path.to_str().map(ToOwned::to_owned).unwrap(),
+ path: abs_path.to_string_lossy().into_owned(),
breakpoints,
});
}