I'd like to return the relative path from an absolute path.
E.g.:
use std::path::PathBuf;
fn main() {
let any_path = PathBuf::from("/abc/def/foo/bar".to_string());
let current = PathBuf::from("/abc/def/here".to_string());
println!("The relative path is: {:?}", make_relative(&any_path, ¤t));
}
The function make_relative
should do that work in order to have this output:
The relative path is: "../foo/bar"