Skip to main content

distro

Function distro 

Source
pub fn distro() -> &'static str
Expand description

The distribution’s name on Linux (“Ubuntu”, “Fedora Linux”, “Arch Linux”), and the operating system’s elsewhere (“Windows”, “macOS”, “Android”, “iOS”). Never empty; “Linux” when a Linux system says nothing about itself.

let d = sys_lib::os::distro();
assert!(!d.is_empty());
#[cfg(windows)]
assert_eq!(d, "Windows");