diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-04-28 14:17:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-28 14:17:08 +0200 |
| commit | 95abeb0705fd0e5c4a14cfa900b90b9a5de34577 (patch) | |
| tree | 8b2be060f44cb174149ea336a944f84f0431b706 /src/libstd | |
| parent | 5f0dc0e1ffb10ff9277aacae9bff3e70d342c1d4 (diff) | |
| parent | 8951eea9b7c9a352d0d0d6485526875ebf97fb95 (diff) | |
| download | rust-95abeb0705fd0e5c4a14cfa900b90b9a5de34577.tar.gz rust-95abeb0705fd0e5c4a14cfa900b90b9a5de34577.zip | |
Rollup merge of #60022 - nathankleyn:fix-issue-59543, r=Centril
Document `Item` type in `std::env::SplitPaths` iterator. Previously there wasn't any documentation to show what the type of `Item` was inside `std::env::SplitPaths`. Now, in the same format as other examples of docs in `std` for `Iterator#Item`, we mention the type. This fixes #59543. r? @steveklabnik
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/env.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libstd/env.rs b/src/libstd/env.rs index 01b301cb43d..c0d0c23e469 100644 --- a/src/libstd/env.rs +++ b/src/libstd/env.rs @@ -359,9 +359,12 @@ fn _remove_var(k: &OsStr) { /// An iterator that splits an environment variable into paths according to /// platform-specific conventions. /// +/// The iterator element type is [`PathBuf`]. +/// /// This structure is created by the [`std::env::split_paths`] function. See its /// documentation for more. /// +/// [`PathBuf`]: ../../std/path/struct.PathBuf.html /// [`std::env::split_paths`]: fn.split_paths.html #[stable(feature = "env", since = "1.0.0")] pub struct SplitPaths<'a> { inner: os_imp::SplitPaths<'a> } @@ -369,7 +372,8 @@ pub struct SplitPaths<'a> { inner: os_imp::SplitPaths<'a> } /// Parses input according to platform conventions for the `PATH` /// environment variable. /// -/// Returns an iterator over the paths contained in `unparsed`. +/// Returns an iterator over the paths contained in `unparsed`. The iterator +/// element type is [`PathBuf`]. /// /// # Examples /// @@ -386,6 +390,8 @@ pub struct SplitPaths<'a> { inner: os_imp::SplitPaths<'a> } /// None => println!("{} is not defined in the environment.", key) /// } /// ``` +/// +/// [`PathBuf`]: ../../std/path/struct.PathBuf.html #[stable(feature = "env", since = "1.0.0")] pub fn split_paths<T: AsRef<OsStr> + ?Sized>(unparsed: &T) -> SplitPaths<'_> { SplitPaths { inner: os_imp::split_paths(unparsed.as_ref()) } |
