Skip to content

Commit c382ff8

Browse files
Rollup merge of #39028 - frewsxcv:libstd-env-docs, r=brson
Minor improvements to docs in std::env structures/functions. * Call functions "functions" instead of "methods". * Link structures to their constructor functions * Add other misc. documentation links
2 parents 1293b79 + 58a470e commit c382ff8

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/libstd/env.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
//! Inspection and manipulation of the process's environment.
1212
//!
13-
//! This module contains methods to inspect various aspects such as
13+
//! This module contains functions to inspect various aspects such as
1414
//! environment variables, process arguments, the current directory, and various
1515
//! other important directories.
1616
@@ -68,15 +68,17 @@ pub fn set_current_dir<P: AsRef<Path>>(p: P) -> io::Result<()> {
6868

6969
/// An iterator over a snapshot of the environment variables of this process.
7070
///
71-
/// This iterator is created through `std::env::vars()` and yields `(String,
72-
/// String)` pairs.
71+
/// This structure is created through the [`std::env::vars`] function.
72+
///
73+
/// [`std::env::vars`]: fn.vars.html
7374
#[stable(feature = "env", since = "1.0.0")]
7475
pub struct Vars { inner: VarsOs }
7576

7677
/// An iterator over a snapshot of the environment variables of this process.
7778
///
78-
/// This iterator is created through `std::env::vars_os()` and yields
79-
/// `(OsString, OsString)` pairs.
79+
/// This structure is created through the [`std::env::vars_os`] function.
80+
///
81+
/// [`std::env::vars_os`]: fn.vars_os.html
8082
#[stable(feature = "env", since = "1.0.0")]
8183
pub struct VarsOs { inner: os_imp::Env }
8284

@@ -218,7 +220,9 @@ fn _var_os(key: &OsStr) -> Option<OsString> {
218220
})
219221
}
220222

221-
/// Possible errors from the `env::var` method.
223+
/// Possible errors from the [`env::var`] function.
224+
///
225+
/// [env::var]: fn.var.html
222226
#[derive(Debug, PartialEq, Eq, Clone)]
223227
#[stable(feature = "env", since = "1.0.0")]
224228
pub enum VarError {
@@ -570,7 +574,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
570574
/// An iterator over the arguments of a process, yielding a [`String`] value
571575
/// for each argument.
572576
///
573-
/// This structure is created through the [`std::env::args`] method.
577+
/// This structure is created through the [`std::env::args`] function.
574578
///
575579
/// [`String`]: ../string/struct.String.html
576580
/// [`std::env::args`]: ./fn.args.html
@@ -580,7 +584,7 @@ pub struct Args { inner: ArgsOs }
580584
/// An iterator over the arguments of a process, yielding an [`OsString`] value
581585
/// for each argument.
582586
///
583-
/// This structure is created through the [`std::env::args_os`] method.
587+
/// This structure is created through the [`std::env::args_os`] function.
584588
///
585589
/// [`OsString`]: ../ffi/struct.OsString.html
586590
/// [`std::env::args_os`]: ./fn.args_os.html

0 commit comments

Comments
 (0)