Crate is_root

Source
Expand description

A simple library to detect whether you are root/admin or not

§Usage

use is_root::is_root;

if is_root() {
    println!("Doing something dangerous")
} else {
    eprintln!("Run me as root")
}

Functions§

is_root
Returns true if user is root; false otherwise