Crate normalize_path

source ·
Expand description

Normalizes paths similarly to canonicalize, but without performing I/O.

This is like Python’s os.path.normpath.

Initially adapted from Cargo’s implementation.

Example

use normalize_path::NormalizePath;
use std::path::Path;

assert_eq!(
    Path::new("/A/foo/../B/./").normalize(),
    Path::new("/A/B")
);

Traits