trimpath
When all you need is the last few parts of a path.
This crate implements the TrimmablePath trait on std::path::Path so you can easily obtain the last n parts of a path.
Usage
// in Cargo.toml
[dependencies]
pathtrim = "1.0.0"
use Path;
// at the top of your source file
use TrimmablePath;
// TrimmablePath is automatically implemented for all std::path::Paths in scope
let path = new;
let trimmed = path.trim_to_nth;
assert!;
assert_eq!;
let trimmed = path.trim_to_nth;
assert!;