Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some internal docs links for Args/ArgsOs #37925

Merged
merged 1 commit into from
Nov 23, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions src/libstd/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,17 +546,23 @@ pub fn current_exe() -> io::Result<PathBuf> {
os_imp::current_exe()
}

/// An iterator over the arguments of a process, yielding a `String` value
/// An iterator over the arguments of a process, yielding a [`String`] value
/// for each argument.
///
/// This structure is created through the `std::env::args` method.
/// This structure is created through the [`std::env::args`] method.
///
/// [`String`]: ../string/struct.String.html
/// [`std::env::args`]: ./fn.args.html
#[stable(feature = "env", since = "1.0.0")]
pub struct Args { inner: ArgsOs }

/// An iterator over the arguments of a process, yielding an `OsString` value
/// An iterator over the arguments of a process, yielding an [`OsString`] value
/// for each argument.
///
/// This structure is created through the `std::env::args_os` method.
/// This structure is created through the [`std::env::args_os`] method.
///
/// [`OsString`]: ../ffi/struct.OsString.html
/// [`std::env::args_os`]: ./fn.args_os.html
#[stable(feature = "env", since = "1.0.0")]
pub struct ArgsOs { inner: sys::args::Args }

Expand All @@ -571,7 +577,7 @@ pub struct ArgsOs { inner: sys::args::Args }
///
/// The returned iterator will panic during iteration if any argument to the
/// process is not valid unicode. If this is not desired,
/// use the `args_os` function instead.
/// use the [`args_os`] function instead.
///
/// # Examples
///
Expand All @@ -583,6 +589,8 @@ pub struct ArgsOs { inner: sys::args::Args }
/// println!("{}", argument);
/// }
/// ```
///
/// [`args_os`]: ./fn.args_os.html
#[stable(feature = "env", since = "1.0.0")]
pub fn args() -> Args {
Args { inner: args_os() }
Expand Down