about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAris Merchant <22333129+inquisitivecrystal@users.noreply.github.com>2021-07-05 22:12:48 -0700
committerAris Merchant <22333129+inquisitivecrystal@users.noreply.github.com>2021-07-05 22:19:30 -0700
commitd9752c7d843f3f93ed7f570b072aec8eb5127a96 (patch)
tree0dca0f9acc4eb73d9f6650e7f76db8ed37bf9c26
parenta12107afaaa634cd7352d3828caef89a975299bb (diff)
downloadrust-d9752c7d843f3f93ed7f570b072aec8eb5127a96.tar.gz
rust-d9752c7d843f3f93ed7f570b072aec8eb5127a96.zip
Improve env var getter docs
-rw-r--r--library/std/src/env.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/library/std/src/env.rs b/library/std/src/env.rs
index a7b27486811..a359ad3b558 100644
--- a/library/std/src/env.rs
+++ b/library/std/src/env.rs
@@ -185,11 +185,9 @@ impl fmt::Debug for VarsOs {
 ///
 /// # Errors
 ///
-/// Errors if the environment variable is not present.
-/// Errors if the environment variable is not valid Unicode. If this is not desired, consider using
-/// [`var_os`].
-/// May error if the `key` is empty, contains an ASCII equals sign `'='`, or contains the NUL character `'\0'`.
-/// May error when the value contains the NUL character.
+/// Returns `[None]` if the environment variable isn't set.
+/// Returns `[None]` if the environment variable is not valid Unicode. If this is not
+/// desired, consider using [`var_os`].
 ///
 /// # Examples
 ///
@@ -223,9 +221,8 @@ fn _var(key: &OsStr) -> Result<String, VarError> {
 ///
 /// # Errors
 ///
-/// Errors if the variable isn't set.
-/// May error if the `key` is empty, contains an ASCII equals sign `'='`, or contains the NUL character `'\0'`.
-/// May error when the value contains the NUL character.
+/// Returns `[None]` if the variable isn't set.
+/// May return `[None]` if the variable value contains the NUL character.
 ///
 /// # Examples
 ///