File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,10 @@ pub fn vars() -> Vars {
124
124
/// variables at the time of this invocation. Modifications to environment
125
125
/// variables afterwards will not be reflected in the returned iterator.
126
126
///
127
+ /// Note that the returned iterator will not check if the environment variables
128
+ /// are valid Unicode. If you want to panic on invalid UTF-8,
129
+ /// use the [`vars`] function instead.
130
+ ///
127
131
/// # Examples
128
132
///
129
133
/// ```
@@ -180,8 +184,9 @@ impl fmt::Debug for VarsOs {
180
184
///
181
185
/// # Errors
182
186
///
183
- /// * Environment variable is not present
184
- /// * Environment variable is not valid unicode
187
+ /// Errors if the environment variable is not present.
188
+ /// Errors if the environment variable is not valid Unicode. If this is not desired, consider using
189
+ /// [`var_os`].
185
190
///
186
191
/// # Panics
187
192
///
@@ -221,6 +226,10 @@ fn _var(key: &OsStr) -> Result<String, VarError> {
221
226
/// `'='` or the NUL character `'\0'`, or when the value contains the NUL
222
227
/// character.
223
228
///
229
+ /// Note that the method will not check if the environment variable
230
+ /// is valid Unicode. If you want to have an error on invalid UTF-8,
231
+ /// use the [`var`] function instead.
232
+ ///
224
233
/// # Examples
225
234
///
226
235
/// ```
You can’t perform that action at this time.
0 commit comments