Skip to content

Commit 5775ce1

Browse files
refactor(common): improve URL path handling in runtime transport (#10493)
Update runtime_transport.rs
1 parent 59030b8 commit 5775ce1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

crates/common/src/provider/runtime_transport.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,8 @@ fn url_to_file_path(url: &Url) -> Result<PathBuf, ()> {
313313

314314
let url_str = url.as_str();
315315

316-
if url_str.starts_with(PREFIX) {
317-
let pipe_name = &url_str[PREFIX.len()..];
318-
let pipe_path = format!(r"\\.\pipe\{}", pipe_name);
316+
if let Some(pipe_name) = url_str.strip_prefix(PREFIX) {
317+
let pipe_path = format!(r"\\.\pipe\{pipe_name}");
319318
return Ok(PathBuf::from(pipe_path));
320319
}
321320

0 commit comments

Comments
 (0)