1 unstable release

0.1.0 Mar 13, 2021

#19 in #present

Download history 32/week @ 2024-11-13 60/week @ 2024-11-20 59/week @ 2024-11-27 54/week @ 2024-12-04 50/week @ 2024-12-11 19/week @ 2024-12-18 2/week @ 2024-12-25 17/week @ 2025-01-01 22/week @ 2025-01-08 34/week @ 2025-01-15 31/week @ 2025-01-22 16/week @ 2025-01-29 31/week @ 2025-02-05 32/week @ 2025-02-12 57/week @ 2025-02-19 29/week @ 2025-02-26

153 downloads per month
Used in 11 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–510KB