Skip to main content

is_contained

Function is_contained 

Source
pub fn is_contained(pathname: &str, base: &str) -> Option<String>
Expand description

pathname relative to base when it lies underneath it (both made absolute against the cwd first), else None. Port of Perl’s pathname_is_contained (Util/Pathname.pm L179-186); a result that stays absolute (no common root: another Windows drive) is not contained either.