Function dirname

Source
pub fn dirname(path: &Path) -> &Path
Expand description

Given a path, compue the parent directory path.

If the path is relative, it assumes that it is relative to the current directory (.). When the root path (/) is given, it returns the root path (/).