[][src]Function rusteam::filesystem::has_same_name_as_parent_dir

pub fn has_same_name_as_parent_dir(filepath: &Path) -> bool

Checks if the last two components of the filepath are equal.

Caveats

Is automatically false when:

  • there is no parent directory

Examples

let path = PathBuf::from("/path/to/entry/entry");
assert!(has_same_name_as_parent_dir(&path))