1 unstable release

0.1.0 Mar 13, 2021

#17 in #present

Download history 23/week @ 2023-11-27 13/week @ 2023-12-04 29/week @ 2023-12-11 35/week @ 2023-12-18 20/week @ 2023-12-25 8/week @ 2024-01-01 37/week @ 2024-01-08 34/week @ 2024-01-15 29/week @ 2024-01-22 23/week @ 2024-01-29 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

315 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

~57–530KB