cnctd_utils 0.1.1

Collection of cnctd tools and traits
Documentation
1
2
3
4
5
use std::path::Path;

pub fn get_relative_path(parent: &Path, child: &Path) -> Option<String> {
    child.strip_prefix(parent).ok().map(|path| path.to_str().unwrap().to_string())
}