MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / canonicalize_path

Method canonicalize_path

rust/src/lib.rs:1529–1548  ·  view source on GitHub ↗
(&self, path_buf: PathBuf)

Source from the content-addressed store, hash-verified

1527 }
1528
1529 fn canonicalize_path(&self, path_buf: PathBuf) -> String {
1530 let mut canon_path = path_to_string(&path_buf);
1531 if WINDOWS.is(self.get_os()) || canon_path.starts_with(UNC_PREFIX) {
1532 canon_path = path_to_string(
1533 &path_buf
1534 .as_path()
1535 .canonicalize()
1536 .unwrap_or(path_buf.clone()),
1537 )
1538 .replace(UNC_PREFIX, "")
1539 }
1540 if !path_to_string(&path_buf).eq(&canon_path) {
1541 self.get_logger().trace(format!(
1542 "Path {} has been canonicalized to {}",
1543 path_buf.display(),
1544 canon_path
1545 ));
1546 }
1547 canon_path
1548 }
1549
1550 fn get_escaped_path(&self, string_path: String) -> String {
1551 let mut escaped_path = string_path.clone();

Callers 3

detect_browser_pathMethod · 0.80
get_escaped_pathMethod · 0.80
get_cache_pathMethod · 0.80

Implementers 8

edge.rsrust/src/edge.rs
iexplorer.rsrust/src/iexplorer.rs
safaritp.rsrust/src/safaritp.rs
electron.rsrust/src/electron.rs
chrome.rsrust/src/chrome.rs
firefox.rsrust/src/firefox.rs
grid.rsrust/src/grid.rs
safari.rsrust/src/safari.rs

Calls 5

path_to_stringFunction · 0.85
get_osMethod · 0.80
traceMethod · 0.80
isMethod · 0.65
get_loggerMethod · 0.45

Tested by

no test coverage detected