Skip to content

Commit af5625d

Browse files
committed
docs: add stdlib env::var(_os) panic
1 parent ee36cfa commit af5625d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/libstd/env.rs

+12
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,12 @@ impl fmt::Debug for VarsOs {
182182
/// * Environment variable is not present
183183
/// * Environment variable is not valid unicode
184184
///
185+
/// # Panics
186+
///
187+
/// This function may panic if `key` is empty, contains an ASCII equals sign
188+
/// `'='` or the NUL character `'\0'`, or when the value contains the NUL
189+
/// character.
190+
///
185191
/// # Examples
186192
///
187193
/// ```
@@ -210,6 +216,12 @@ fn _var(key: &OsStr) -> Result<String, VarError> {
210216
///
211217
/// [`None`]: ../option/enum.Option.html#variant.None
212218
///
219+
/// # Panics
220+
///
221+
/// This function may panic if `key` is empty, contains an ASCII equals sign
222+
/// `'='` or the NUL character `'\0'`, or when the value contains the NUL
223+
/// character.
224+
///
213225
/// # Examples
214226
///
215227
/// ```

0 commit comments

Comments
 (0)