-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Minor improvements to docs in std::env structures/functions. #39028
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
|
||
//! Inspection and manipulation of the process's environment. | ||
//! | ||
//! This module contains methods to inspect various aspects such as | ||
//! This module contains functions to inspect various aspects such as | ||
//! environment variables, process arguments, the current directory, and various | ||
//! other important directories. | ||
|
||
|
@@ -68,15 +68,17 @@ pub fn set_current_dir<P: AsRef<Path>>(p: P) -> io::Result<()> { | |
|
||
/// An iterator over a snapshot of the environment variables of this process. | ||
/// | ||
/// This iterator is created through `std::env::vars()` and yields `(String, | ||
/// String)` pairs. | ||
/// This structure is created through the [`std::env::vars`] function. | ||
/// | ||
/// [`std::env::vars`]: fn.vars.html | ||
#[stable(feature = "env", since = "1.0.0")] | ||
pub struct Vars { inner: VarsOs } | ||
|
||
/// An iterator over a snapshot of the environment variables of this process. | ||
/// | ||
/// This iterator is created through `std::env::vars_os()` and yields | ||
/// `(OsString, OsString)` pairs. | ||
/// This structure is created through the [`std::env::vars_os`] function. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto here. |
||
/// | ||
/// [`std::env::vars_os`]: fn.vars_os.html | ||
#[stable(feature = "env", since = "1.0.0")] | ||
pub struct VarsOs { inner: os_imp::Env } | ||
|
||
|
@@ -218,7 +220,9 @@ fn _var_os(key: &OsStr) -> Option<OsString> { | |
}) | ||
} | ||
|
||
/// Possible errors from the `env::var` method. | ||
/// Possible errors from the [`env::var`] function. | ||
/// | ||
/// [env::var]: fn.var.html | ||
#[derive(Debug, PartialEq, Eq, Clone)] | ||
#[stable(feature = "env", since = "1.0.0")] | ||
pub enum VarError { | ||
|
@@ -570,7 +574,7 @@ pub fn current_exe() -> io::Result<PathBuf> { | |
/// 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`] function. | ||
/// | ||
/// [`String`]: ../string/struct.String.html | ||
/// [`std::env::args`]: ./fn.args.html | ||
|
@@ -580,7 +584,7 @@ pub struct Args { inner: ArgsOs } | |
/// 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`] function. | ||
/// | ||
/// [`OsString`]: ../ffi/struct.OsString.html | ||
/// [`std::env::args_os`]: ./fn.args_os.html | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous sentence was strictly more informative IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How so? "yields
(String, String)
pairs." isn't saying anything more than what's displayed in theIterator
section ofEnv
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, never mind me, I totally thought this was documentation for the function, which hasn’t such information displayed.