Skip to main content

parse_os_release

Function parse_os_release 

Source
pub fn parse_os_release(content: &str) -> Option<String>
Expand description

Parses the contents of an os-release file (as found at /etc/os-release and described by the systemd spec) into a human-readable string such as "ubuntu 24.04", combining the ID and VERSION_ID fields.

Returns None if no ID field is present. When VERSION_ID is absent (e.g. on rolling releases), only the ID is returned.