Once the loop hits this arm of the match, it will ignore any ParentDir segments in the base path:
let path = "some/path";
assert_eq!(pathdiff::diff_paths(path, "some/foo/baz/path"), PathBuf::from("../../../path"));
// this fails and returns "../../../../../path" instead.
assert_eq!(pathdiff::diff_paths(path, "some/foo/bar/../baz/path"), PathBuf::from("../../../path"));