MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / normalize_path

Function normalize_path

crates/hyperqueue/src/common/placeholders.rs:179–185  ·  view source on GitHub ↗

Adds the given base `directory` to the `path`, if it's not already absolute.

(path: &Path, directory: &Path)

Source from the content-addressed store, hash-verified

177
178/// Adds the given base `directory` to the `path`, if it's not already absolute.
179pub fn normalize_path(path: &Path, directory: &Path) -> PathBuf {
180 if path.is_absolute() {
181 path.to_path_buf()
182 } else {
183 [directory, path].into_iter().collect()
184 }
185}
186
187#[derive(Debug, Eq, PartialEq)]
188pub enum StringPart<'a> {

Callers 2

prepare_jobFunction · 0.85
resolve_pathFunction · 0.85

Calls 1

into_iterMethod · 0.45

Tested by

no test coverage detected