Make getenv
return an Option instead of a Result
This commit is contained in:
parent
d26e01e9df
commit
a12107afaa
7 changed files with 20 additions and 36 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue