add situation where var_os returns None
Re-introduced some of the former errors as situations where `None` is returned.
This commit is contained in:
parent
9f1a3a131b
commit
c252f0d404
1 changed files with 7 additions and 1 deletions
|
@ -236,7 +236,13 @@ fn _var(key: &OsStr) -> Result<String, VarError> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Fetches the environment variable `key` from the current process, returning
|
/// Fetches the environment variable `key` from the current process, returning
|
||||||
/// [`None`] if the variable isn't set or there's another error.
|
/// [`None`] in the following situations:
|
||||||
|
///
|
||||||
|
/// - the environment variable isn't set
|
||||||
|
/// - the environment variable's name contains
|
||||||
|
/// the equal sign character (`=`) or the NUL character
|
||||||
|
///
|
||||||
|
/// If this is not desired, consider using [`var_os`].
|
||||||
///
|
///
|
||||||
/// Note that the method will not check if the environment variable
|
/// Note that the method will not check if the environment variable
|
||||||
/// is valid Unicode. If you want to have an error on invalid UTF-8,
|
/// is valid Unicode. If you want to have an error on invalid UTF-8,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue