77//! There are several functions and structs in this module that have a
88//! counterpart ending in `os`. Those ending in `os` will return an [`OsString`]
99//! and those without will return a [`String`].
10- //!
11- //! [`OsString`]: ../../std/ffi/struct.OsString.html
12- //! [`String`]: ../string/struct.String.html
1310
1411#![ stable( feature = "env" , since = "1.0.0" ) ]
1512
@@ -31,8 +28,7 @@ use crate::sys::os as os_imp;
3128/// * Current directory does not exist.
3229/// * There are insufficient permissions to access the current directory.
3330///
34- /// [`PathBuf`]: ../../std/path/struct.PathBuf.html
35- /// [`Err`]: ../../std/result/enum.Result.html#method.err
31+ /// [`Err`]: Result::Err
3632///
3733/// # Examples
3834///
@@ -54,7 +50,7 @@ pub fn current_dir() -> io::Result<PathBuf> {
5450///
5551/// Returns an [`Err`] if the operation fails.
5652///
57- /// [`Err`]: ../../std/result/enum. Result.html#method.err
53+ /// [`Err`]: Result::Err
5854///
5955/// # Examples
6056///
@@ -76,7 +72,7 @@ pub fn set_current_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
7672/// This structure is created by the [`std::env::vars`] function. See its
7773/// documentation for more.
7874///
79- /// [`std::env::vars`]: fn. vars.html
75+ /// [`std::env::vars`]: vars
8076#[ stable( feature = "env" , since = "1.0.0" ) ]
8177pub struct Vars {
8278 inner : VarsOs ,
@@ -87,7 +83,7 @@ pub struct Vars {
8783/// This structure is created by the [`std::env::vars_os`] function. See
8884/// its documentation for more.
8985///
90- /// [`std::env::vars_os`]: fn. vars_os.html
86+ /// [`std::env::vars_os`]: vars_os
9187#[ stable( feature = "env" , since = "1.0.0" ) ]
9288pub struct VarsOs {
9389 inner : os_imp:: Env ,
@@ -106,7 +102,7 @@ pub struct VarsOs {
106102/// environment is not valid unicode. If this is not desired, consider using the
107103/// [`env::vars_os`] function.
108104///
109- /// [`env::vars_os`]: fn. vars_os.html
105+ /// [`env::vars_os`]: vars_os
110106///
111107/// # Examples
112108///
@@ -222,7 +218,7 @@ fn _var(key: &OsStr) -> Result<String, VarError> {
222218/// Fetches the environment variable `key` from the current process, returning
223219/// [`None`] if the variable isn't set.
224220///
225- /// [`None`]: ../option/enum. Option.html#variant. None
221+ /// [`None`]: Option:: None
226222///
227223/// # Panics
228224///
@@ -254,7 +250,7 @@ fn _var_os(key: &OsStr) -> Option<OsString> {
254250/// The error type for operations interacting with environment variables.
255251/// Possibly returned from the [`env::var`] function.
256252///
257- /// [`env::var`]: fn. var.html
253+ /// [`env::var`]: var
258254#[ derive( Debug , PartialEq , Eq , Clone ) ]
259255#[ stable( feature = "env" , since = "1.0.0" ) ]
260256pub enum VarError {
@@ -382,8 +378,7 @@ fn _remove_var(k: &OsStr) {
382378/// This structure is created by the [`std::env::split_paths`] function. See its
383379/// documentation for more.
384380///
385- /// [`PathBuf`]: ../../std/path/struct.PathBuf.html
386- /// [`std::env::split_paths`]: fn.split_paths.html
381+ /// [`std::env::split_paths`]: split_paths
387382#[ stable( feature = "env" , since = "1.0.0" ) ]
388383pub struct SplitPaths < ' a > {
389384 inner : os_imp:: SplitPaths < ' a > ,
@@ -410,8 +405,6 @@ pub struct SplitPaths<'a> {
410405/// None => println!("{} is not defined in the environment.", key)
411406/// }
412407/// ```
413- ///
414- /// [`PathBuf`]: ../../std/path/struct.PathBuf.html
415408#[ stable( feature = "env" , since = "1.0.0" ) ]
416409pub fn split_paths < T : AsRef < OsStr > + ?Sized > ( unparsed : & T ) -> SplitPaths < ' _ > {
417410 SplitPaths { inner : os_imp:: split_paths ( unparsed. as_ref ( ) ) }
@@ -438,7 +431,7 @@ impl fmt::Debug for SplitPaths<'_> {
438431/// The error type for operations on the `PATH` variable. Possibly returned from
439432/// the [`env::join_paths`] function.
440433///
441- /// [`env::join_paths`]: fn. join_paths.html
434+ /// [`env::join_paths`]: join_paths
442435#[ derive( Debug ) ]
443436#[ stable( feature = "env" , since = "1.0.0" ) ]
444437pub struct JoinPathsError {
@@ -450,13 +443,11 @@ pub struct JoinPathsError {
450443///
451444/// # Errors
452445///
453- /// Returns an [`Err`][err] (containing an error message) if one of the input
446+ /// Returns an [`Err`] (containing an error message) if one of the input
454447/// [`Path`]s contains an invalid character for constructing the `PATH`
455448/// variable (a double quote on Windows or a colon on Unix).
456449///
457- /// [`Path`]: ../../std/path/struct.Path.html
458- /// [`OsString`]: ../../std/ffi/struct.OsString.html
459- /// [err]: ../../std/result/enum.Result.html#variant.Err
450+ /// [Err]: Result::Err
460451///
461452/// # Examples
462453///
@@ -508,7 +499,7 @@ pub struct JoinPathsError {
508499/// }
509500/// ```
510501///
511- /// [`env::split_paths`]: fn. split_paths.html
502+ /// [`env::split_paths`]: split_paths
512503#[ stable( feature = "env" , since = "1.0.0" ) ]
513504pub fn join_paths < I , T > ( paths : I ) -> Result < OsString , JoinPathsError >
514505where
@@ -688,8 +679,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
688679/// set to arbitrary text, and may not even exist. This means this property
689680/// should not be relied upon for security purposes.
690681///
691- /// [`String`]: ../string/struct.String.html
692- /// [`std::env::args`]: ./fn.args.html
682+ /// [`std::env::args`]: args
693683#[ stable( feature = "env" , since = "1.0.0" ) ]
694684pub struct Args {
695685 inner : ArgsOs ,
@@ -705,8 +695,7 @@ pub struct Args {
705695/// set to arbitrary text, and may not even exist. This means this property
706696/// should not be relied upon for security purposes.
707697///
708- /// [`OsString`]: ../ffi/struct.OsString.html
709- /// [`std::env::args_os`]: ./fn.args_os.html
698+ /// [`std::env::args_os`]: args_os
710699#[ stable( feature = "env" , since = "1.0.0" ) ]
711700pub struct ArgsOs {
712701 inner : sys:: args:: Args ,
@@ -744,8 +733,6 @@ pub struct ArgsOs {
744733/// println!("{}", argument);
745734/// }
746735/// ```
747- ///
748- /// [`args_os`]: ./fn.args_os.html
749736#[ stable( feature = "env" , since = "1.0.0" ) ]
750737pub fn args ( ) -> Args {
751738 Args { inner : args_os ( ) }
0 commit comments