Crates.io | plain_path |
lib.rs | plain_path |
version | 0.1.0 |
source | src |
created_at | 2021-03-13 08:14:23.428383 |
updated_at | 2021-03-13 08:14:23.428383 |
description | Expands `~` in a path if present. |
homepage | |
repository | https://github.com/azriel91/plain_path |
max_upload_size | |
id | 368223 |
size | 17,522 |
Expands ~
in a path if present.
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());
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.