Function openrr_client::resolve_relative_path

source ·
pub fn resolve_relative_path<B: AsRef<Path>, P: AsRef<Path>>(
    base_path: B,
    path: P,
) -> Result<PathBuf, Error>
Expand description

Make relative path into absolute path from base file (not base dir).

§Example

use std::path::PathBuf;
let abs_path = openrr_client::resolve_relative_path("/home/a/base_file.toml", "../another_file.mp3").unwrap();
assert_eq!(abs_path, PathBuf::from("/home/a/../another_file.mp3"));