Make getenv return an Option instead of a Result

This commit is contained in:
Aris Merchant 2021-06-24 16:04:24 -07:00
parent d26e01e9df
commit a12107afaa
7 changed files with 20 additions and 36 deletions

View file

@ -244,7 +244,7 @@ pub fn var_os<K: AsRef<OsStr>>(key: K) -> Option<OsString> {
}
fn _var_os(key: &OsStr) -> Option<OsString> {
os_imp::getenv(key).ok()?
os_imp::getenv(key)
}
/// The error type for operations interacting with environment variables.