1 unstable release
0.1.0 | Mar 13, 2021 |
---|
#10 in #present
163 downloads per month
Used in 11 crates
(4 directly)
7KB
61 lines
〽️ Plain Path
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());
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Contribution
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.
lib.rs
:
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());
Dependencies
~58–510KB