#ssh #async

plain_path

Expands ~ in a path if present

1 unstable release

0.1.0 Mar 13, 2021

#113 in #ssh

Download history 134/week @ 2023-06-12 258/week @ 2023-06-19 268/week @ 2023-06-26 239/week @ 2023-07-03 305/week @ 2023-07-10 210/week @ 2023-07-17 268/week @ 2023-07-24 242/week @ 2023-07-31 142/week @ 2023-08-07 177/week @ 2023-08-14 133/week @ 2023-08-21 567/week @ 2023-08-28 3500/week @ 2023-09-04 1828/week @ 2023-09-11 1473/week @ 2023-09-18 1335/week @ 2023-09-25

8,213 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–405KB