absolutize_and_normalize

Function absolutize_and_normalize 

Source
pub fn absolutize_and_normalize(input: &Path) -> Result<PathBuf>
Expand description

Resolves a possibly-relative path to an absolute, lexically normalized form.

If input is absolute it is normalized in place; otherwise it is joined onto the current working directory before normalization. The result has no . or .. components and does not access the filesystem, so it is safe to use for display even when the path does not exist.

§Errors

Returns an io::Error when the current directory cannot be determined and input is relative.

§Examples

use ito_config::ito_dir::absolutize_and_normalize;
use std::path::Path;

let abs = absolutize_and_normalize(Path::new(".")).unwrap();
assert!(abs.is_absolute());