(path: &Path)
| 476 | |
| 477 | #[cfg(target_os = "windows")] |
| 478 | fn convert_to_unix_path(path: &Path) -> Option<String> { |
| 479 | let mut path_str = String::new(); |
| 480 | for component in path.components() { |
| 481 | if let std::path::Component::Normal(os_str) = component { |
| 482 | if !path_str.is_empty() { |
| 483 | path_str.push('/'); |
| 484 | } |
| 485 | path_str.push_str(os_str.to_str()?); |
| 486 | } |
| 487 | } |
| 488 | Some(path_str) |
| 489 | } |
| 490 | |
| 491 | #[cfg(not(target_os = "windows"))] |
| 492 | fn convert_to_unix_path(path: &Path) -> Option<String> { |
no test coverage detected