normalize_path

Function normalize_path 

Source
pub fn normalize_path<P: AsRef<Path>>(path: P) -> PathBuf
Expand description

Normalizes a path by stripping slashes, resolving backtracking, and using forward slashes.

§Arguments

path: The path to normalize.

§Example

use std::path::Path;
use virtual_filesystem::util::normalize_path;

assert_eq!(normalize_path("///////"), Path::new("/"));
assert_eq!(normalize_path("./test/something/../"), Path::new("test"));
assert_eq!(normalize_path("../test"), Path::new("test"));