Skip to content

Commit 8a7a665

Browse files
Rollup merge of #109894 - fleetingbytes:109893-var_os-never-returns-an-error, r=cuviper
Remove Errors section from var_os docs Remove `Errors` section from `var_os` documentation, fixes #109893
2 parents 4a24aab + 7d26963 commit 8a7a665

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

library/std/src/env.rs

+5-12
Original file line numberDiff line numberDiff line change
@@ -236,21 +236,14 @@ fn _var(key: &OsStr) -> Result<String, VarError> {
236236
}
237237

238238
/// Fetches the environment variable `key` from the current process, returning
239-
/// [`None`] if the variable isn't set or there's another error.
239+
/// [`None`] if the variable isn't set or if there is another error.
240240
///
241-
/// Note that the method will not check if the environment variable
242-
/// is valid Unicode. If you want to have an error on invalid UTF-8,
243-
/// use the [`var`] function instead.
244-
///
245-
/// # Errors
246-
///
247-
/// This function returns an error if the environment variable isn't set.
248-
///
249-
/// This function may return an error if the environment variable's name contains
241+
/// It may return `None` if the environment variable's name contains
250242
/// the equal sign character (`=`) or the NUL character.
251243
///
252-
/// This function may return an error if the environment variable's value contains
253-
/// the NUL character.
244+
/// Note that this function will not check if the environment variable
245+
/// is valid Unicode. If you want to have an error on invalid UTF-8,
246+
/// use the [`var`] function instead.
254247
///
255248
/// # Examples
256249
///

0 commit comments

Comments
 (0)