#expand #tilde #home #directory #path

simple-expand-tilde

An extremely tiny and reliable Rust library that parses tilde expansion

4 releases

0.1.4 Jan 21, 2024
0.1.2 Jan 17, 2024
0.1.1 Jan 17, 2024
0.1.0 Jan 17, 2024

#6 in #home

Download history 118/week @ 2024-01-15 11/week @ 2024-01-22 77/week @ 2024-01-29 134/week @ 2024-02-05 130/week @ 2024-02-12

374 downloads per month

MIT license

3KB

simple-expand-tilde

Crate

An extremely tiny and reliable Rust library that parses tilde expansion.

Usage

use simple_expand_tilde::*;

fn main() {
    // Windows => "C:\Users\<USER>\.rustup"
    // Linux   => "/home/<USER>/.rustuup"
    // Mac     => "/Users/<USER>/.rustup"
    let path = expand_tilde("~/.rustup").unwrap();
    println!("{:?}", path)
}

Dependencies

~0–9MB
~48K SLoC