Skip to content

Commit

Permalink
[rust] Use original path when unwrap fails in canonicalize function (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bonigarcia committed Sep 16, 2023
1 parent 6c84621 commit b56c0b6
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions rust/src/lib.rs
Expand Up @@ -935,13 +935,7 @@ pub trait SeleniumManager {
}

fn canonicalize_path(&self, path_buf: PathBuf) -> String {
let canon_path = path_buf
.as_path()
.canonicalize()
.unwrap()
.to_str()
.unwrap()
.to_string();
let canon_path = path_buf_to_string(path_buf.as_path().canonicalize().unwrap_or(path_buf));
if WINDOWS.is(self.get_os()) {
canon_path.replace(UNC_PREFIX, "")
} else {
Expand Down

0 comments on commit b56c0b6

Please sign in to comment.