[][src]Function is_root::is_root

#[must_use]pub fn is_root() -> bool

Returns true if user is root; false otherwise

use is_root::is_root;

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