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,9 +28,6 @@ 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
36- ///
3731/// # Examples
3832///
3933/// ```
@@ -54,8 +48,6 @@ pub fn current_dir() -> io::Result<PathBuf> {
5448///
5549/// Returns an [`Err`] if the operation fails.
5650///
57- /// [`Err`]: ../../std/result/enum.Result.html#method.err
58- ///
5951/// # Examples
6052///
6153/// ```
@@ -76,7 +68,7 @@ pub fn set_current_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
7668/// This structure is created by the [`std::env::vars`] function. See its
7769/// documentation for more.
7870///
79- /// [`std::env::vars`]: fn. vars.html
71+ /// [`std::env::vars`]: vars
8072#[ stable( feature = "env" , since = "1.0.0" ) ]
8173pub struct Vars {
8274 inner : VarsOs ,
@@ -87,7 +79,7 @@ pub struct Vars {
8779/// This structure is created by the [`std::env::vars_os`] function. See
8880/// its documentation for more.
8981///
90- /// [`std::env::vars_os`]: fn. vars_os.html
82+ /// [`std::env::vars_os`]: vars_os
9183#[ stable( feature = "env" , since = "1.0.0" ) ]
9284pub struct VarsOs {
9385 inner : os_imp:: Env ,
@@ -106,7 +98,7 @@ pub struct VarsOs {
10698/// environment is not valid unicode. If this is not desired, consider using the
10799/// [`env::vars_os`] function.
108100///
109- /// [`env::vars_os`]: fn. vars_os.html
101+ /// [`env::vars_os`]: vars_os
110102///
111103/// # Examples
112104///
@@ -222,8 +214,6 @@ fn _var(key: &OsStr) -> Result<String, VarError> {
222214/// Fetches the environment variable `key` from the current process, returning
223215/// [`None`] if the variable isn't set.
224216///
225- /// [`None`]: ../option/enum.Option.html#variant.None
226- ///
227217/// # Panics
228218///
229219/// This function may panic if `key` is empty, contains an ASCII equals sign
@@ -254,7 +244,7 @@ fn _var_os(key: &OsStr) -> Option<OsString> {
254244/// The error type for operations interacting with environment variables.
255245/// Possibly returned from the [`env::var`] function.
256246///
257- /// [`env::var`]: fn. var.html
247+ /// [`env::var`]: var
258248#[ derive( Debug , PartialEq , Eq , Clone ) ]
259249#[ stable( feature = "env" , since = "1.0.0" ) ]
260250pub enum VarError {
@@ -382,8 +372,7 @@ fn _remove_var(k: &OsStr) {
382372/// This structure is created by the [`std::env::split_paths`] function. See its
383373/// documentation for more.
384374///
385- /// [`PathBuf`]: ../../std/path/struct.PathBuf.html
386- /// [`std::env::split_paths`]: fn.split_paths.html
375+ /// [`std::env::split_paths`]: split_paths
387376#[ stable( feature = "env" , since = "1.0.0" ) ]
388377pub struct SplitPaths < ' a > {
389378 inner : os_imp:: SplitPaths < ' a > ,
@@ -410,8 +399,6 @@ pub struct SplitPaths<'a> {
410399/// None => println!("{} is not defined in the environment.", key)
411400/// }
412401/// ```
413- ///
414- /// [`PathBuf`]: ../../std/path/struct.PathBuf.html
415402#[ stable( feature = "env" , since = "1.0.0" ) ]
416403pub fn split_paths < T : AsRef < OsStr > + ?Sized > ( unparsed : & T ) -> SplitPaths < ' _ > {
417404 SplitPaths { inner : os_imp:: split_paths ( unparsed. as_ref ( ) ) }
@@ -438,7 +425,7 @@ impl fmt::Debug for SplitPaths<'_> {
438425/// The error type for operations on the `PATH` variable. Possibly returned from
439426/// the [`env::join_paths`] function.
440427///
441- /// [`env::join_paths`]: fn. join_paths.html
428+ /// [`env::join_paths`]: join_paths
442429#[ derive( Debug ) ]
443430#[ stable( feature = "env" , since = "1.0.0" ) ]
444431pub struct JoinPathsError {
@@ -450,14 +437,10 @@ pub struct JoinPathsError {
450437///
451438/// # Errors
452439///
453- /// Returns an [`Err`][err] (containing an error message) if one of the input
440+ /// Returns an [`Err`] (containing an error message) if one of the input
454441/// [`Path`]s contains an invalid character for constructing the `PATH`
455442/// variable (a double quote on Windows or a colon on Unix).
456443///
457- /// [`Path`]: ../../std/path/struct.Path.html
458- /// [`OsString`]: ../../std/ffi/struct.OsString.html
459- /// [err]: ../../std/result/enum.Result.html#variant.Err
460- ///
461444/// # Examples
462445///
463446/// Joining paths on a Unix-like platform:
@@ -508,7 +491,7 @@ pub struct JoinPathsError {
508491/// }
509492/// ```
510493///
511- /// [`env::split_paths`]: fn. split_paths.html
494+ /// [`env::split_paths`]: split_paths
512495#[ stable( feature = "env" , since = "1.0.0" ) ]
513496pub fn join_paths < I , T > ( paths : I ) -> Result < OsString , JoinPathsError >
514497where
@@ -688,8 +671,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
688671/// set to arbitrary text, and may not even exist. This means this property
689672/// should not be relied upon for security purposes.
690673///
691- /// [`String`]: ../string/struct.String.html
692- /// [`std::env::args`]: ./fn.args.html
674+ /// [`std::env::args`]: args
693675#[ stable( feature = "env" , since = "1.0.0" ) ]
694676pub struct Args {
695677 inner : ArgsOs ,
@@ -705,8 +687,7 @@ pub struct Args {
705687/// set to arbitrary text, and may not even exist. This means this property
706688/// should not be relied upon for security purposes.
707689///
708- /// [`OsString`]: ../ffi/struct.OsString.html
709- /// [`std::env::args_os`]: ./fn.args_os.html
690+ /// [`std::env::args_os`]: args_os
710691#[ stable( feature = "env" , since = "1.0.0" ) ]
711692pub struct ArgsOs {
712693 inner : sys:: args:: Args ,
@@ -744,8 +725,6 @@ pub struct ArgsOs {
744725/// println!("{}", argument);
745726/// }
746727/// ```
747- ///
748- /// [`args_os`]: ./fn.args_os.html
749728#[ stable( feature = "env" , since = "1.0.0" ) ]
750729pub fn args ( ) -> Args {
751730 Args { inner : args_os ( ) }
0 commit comments