We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9f1a3a1 commit c252f0dCopy full SHA for c252f0d
library/std/src/env.rs
@@ -236,7 +236,13 @@ fn _var(key: &OsStr) -> Result<String, VarError> {
236
}
237
238
/// Fetches the environment variable `key` from the current process, returning
239
-/// [`None`] if the variable isn't set or there's another error.
+/// [`None`] in the following situations:
240
+///
241
+/// - the environment variable isn't set
242
+/// - the environment variable's name contains
243
+/// the equal sign character (`=`) or the NUL character
244
245
+/// If this is not desired, consider using [`var_os`].
246
///
247
/// Note that the method will not check if the environment variable
248
/// is valid Unicode. If you want to have an error on invalid UTF-8,
0 commit comments