pub fn get_parent_directory<T: AsPath + ?Sized>(path: &T) -> Option<String>
Expand description

Returns the parent path.

Arguments

  • path - The path value

Example

use fsio::path;
use fsio::path::as_path::AsPath;
use std::path::Path;

fn main() {
    let dirname = path::get_parent_directory("./src/path/mod.rs");

    assert_eq!(dirname.unwrap(), "./src/path");
}