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

Function convert_to_unix_path

crates/cargo-lambda-build/src/archive.rs:478–489  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

476
477#[cfg(target_os = "windows")]
478fn 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"))]
492fn convert_to_unix_path(path: &Path) -> Option<String> {

Callers 2

binary_path_in_zipMethod · 0.70
include_files_in_zipFunction · 0.70

Calls 3

newFunction · 0.85
pushMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected