Crate is_root
Version 0.1.2
See all is_root's items
A simple library to detect whether you are root/admin or not
use is_root::is_root; if is_root() { println!("Doing something dangerous") } else { eprintln!("Run me as root") }
Returns true if user is root; false otherwise
true
false