pwd 1.4.0

Safe interface to pwd.h
Documentation
1
2
3
4
5
6
7
8
9
10
extern crate pwd;
use pwd::Passwd;

fn main() {
    let me = Passwd::current_user().expect("Could not get current user");
    println!(
        "my username is {}, home directory is {}, and my shell is {}. My uid/gid are {}/{}",
        me.name, me.dir, me.shell, me.uid, me.gid
    );
}