#expand #ssh #path #async #present #plain

plain_path

Expands ~ in a path if present

1 unstable release

0.1.0 Mar 13, 2021

#10 in #present

Download history 46/week @ 2024-07-22 65/week @ 2024-07-29 54/week @ 2024-08-05 78/week @ 2024-08-12 114/week @ 2024-08-19 70/week @ 2024-08-26 47/week @ 2024-09-02 42/week @ 2024-09-09 59/week @ 2024-09-16 91/week @ 2024-09-23 29/week @ 2024-09-30 29/week @ 2024-10-07 36/week @ 2024-10-14 44/week @ 2024-10-21 57/week @ 2024-10-28 24/week @ 2024-11-04

163 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