MCPcopy Create free account
hub / github.com/cargo-lambda/cargo-lambda / convert_to_unix_path

Function convert_to_unix_path

crates/cargo-lambda-new/src/lib.rs:515–526  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

513
514#[cfg(target_os = "windows")]
515fn convert_to_unix_path(path: &Path) -> Option<String> {
516 let mut path_str = String::new();
517 for component in path.components() {
518 if let std::path::Component::Normal(os_str) = component {
519 if !path_str.is_empty() {
520 path_str.push('/');
521 }
522 path_str.push_str(os_str.to_str()?);
523 }
524 }
525 Some(path_str)
526}
527
528#[cfg(not(target_os = "windows"))]
529fn convert_to_unix_path(path: &Path) -> Option<String> {

Callers 2

should_render_fileFunction · 0.70
should_ignore_fileFunction · 0.70

Calls 3

newFunction · 0.85
pushMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected