File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -258,6 +258,9 @@ fn _var(key: &OsStr) -> Result<String, VarError> {
258258/// None => println!("{key} is not defined in the environment.")
259259/// }
260260/// ```
261+ ///
262+ /// If expecting a delimited variable (such as `PATH`), [`split_paths`]
263+ /// can be used to separate items.
261264#[ must_use]
262265#[ stable( feature = "env" , since = "1.0.0" ) ]
263266pub fn var_os < K : AsRef < OsStr > > ( key : K ) -> Option < OsString > {
@@ -441,6 +444,16 @@ pub struct SplitPaths<'a> {
441444/// Returns an iterator over the paths contained in `unparsed`. The iterator
442445/// element type is [`PathBuf`].
443446///
447+ /// On most Unix platforms, the separator is `:` and on Windows it is `;`. This
448+ /// also performs unquoting on Windows.
449+ ///
450+ /// [`join_paths`] can be used to recombine elements.
451+ ///
452+ /// # Panics
453+ ///
454+ /// This will panic on systems where there is no delimited `PATH` variable,
455+ /// such as UEFI.
456+ ///
444457/// # Examples
445458///
446459/// ```
@@ -496,7 +509,8 @@ pub struct JoinPathsError {
496509///
497510/// Returns an [`Err`] (containing an error message) if one of the input
498511/// [`Path`]s contains an invalid character for constructing the `PATH`
499- /// variable (a double quote on Windows or a colon on Unix).
512+ /// variable (a double quote on Windows or a colon on Unix), or if the system
513+ /// does not have a `PATH`-like variable (e.g. UEFI or WASI).
500514///
501515/// # Examples
502516///
You can’t perform that action at this time.
0 commit comments