Skip to main content

contains_component_path

Function contains_component_path 

Source
pub fn contains_component_path(path: &Path, needle: &Path) -> bool
Expand description

Returns whether path contains needle as a contiguous component path.

This is useful for relative metadata protections such as .git or .cache. The comparison uses the same native component semantics as paths_equal and is_within. It is lexical only and does not inspect the filesystem.