Crate plain_path

Source
Expand description

Expands ~ in a path if present.

§Examples

use std::path::Path;
use plain_path::PlainPathExt;

let path = Path::new("~/.ssh/config").plain()?;

// 🍏: "/Users/<user>/.ssh/config"
// 🐧: "/home/<user>/.ssh/config"
println!("{}", path.display());

Structs§

HomeDirNotFound
Error when the user’s home directory cannot be found.

Traits§

PlainPathExt
Provides the plain method to expand ~.

Functions§

plain
Returns the path without special expansion characters.