1 unstable release

0.1.0 Mar 13, 2021

#17 in #present

Download history 28/week @ 2024-02-05 57/week @ 2024-02-12 52/week @ 2024-02-19 63/week @ 2024-02-26 67/week @ 2024-03-04 123/week @ 2024-03-11 77/week @ 2024-03-18 196/week @ 2024-03-25 134/week @ 2024-04-01 102/week @ 2024-04-08 86/week @ 2024-04-15 183/week @ 2024-04-22 83/week @ 2024-04-29 87/week @ 2024-05-06 83/week @ 2024-05-13 174/week @ 2024-05-20

439 downloads per month
Used in 10 crates (4 directly)

MIT/Apache

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

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–530KB