7
7
//! There are several functions and structs in this module that have a
8
8
//! counterpart ending in `os`. Those ending in `os` will return an [`OsString`]
9
9
//! and those without will return a [`String`].
10
- //!
11
- //! [`OsString`]: ../../std/ffi/struct.OsString.html
12
- //! [`String`]: ../string/struct.String.html
13
10
14
11
#![ stable( feature = "env" , since = "1.0.0" ) ]
15
12
@@ -31,8 +28,7 @@ use crate::sys::os as os_imp;
31
28
/// * Current directory does not exist.
32
29
/// * There are insufficient permissions to access the current directory.
33
30
///
34
- /// [`PathBuf`]: ../../std/path/struct.PathBuf.html
35
- /// [`Err`]: ../../std/result/enum.Result.html#method.err
31
+ /// [`Err`]: Result::Err
36
32
///
37
33
/// # Examples
38
34
///
@@ -54,7 +50,7 @@ pub fn current_dir() -> io::Result<PathBuf> {
54
50
///
55
51
/// Returns an [`Err`] if the operation fails.
56
52
///
57
- /// [`Err`]: ../../std/result/enum. Result.html#method.err
53
+ /// [`Err`]: Result::Err
58
54
///
59
55
/// # Examples
60
56
///
@@ -76,7 +72,7 @@ pub fn set_current_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
76
72
/// This structure is created by the [`std::env::vars`] function. See its
77
73
/// documentation for more.
78
74
///
79
- /// [`std::env::vars`]: fn. vars.html
75
+ /// [`std::env::vars`]: vars
80
76
#[ stable( feature = "env" , since = "1.0.0" ) ]
81
77
pub struct Vars {
82
78
inner : VarsOs ,
@@ -87,7 +83,7 @@ pub struct Vars {
87
83
/// This structure is created by the [`std::env::vars_os`] function. See
88
84
/// its documentation for more.
89
85
///
90
- /// [`std::env::vars_os`]: fn. vars_os.html
86
+ /// [`std::env::vars_os`]: vars_os
91
87
#[ stable( feature = "env" , since = "1.0.0" ) ]
92
88
pub struct VarsOs {
93
89
inner : os_imp:: Env ,
@@ -106,7 +102,7 @@ pub struct VarsOs {
106
102
/// environment is not valid unicode. If this is not desired, consider using the
107
103
/// [`env::vars_os`] function.
108
104
///
109
- /// [`env::vars_os`]: fn. vars_os.html
105
+ /// [`env::vars_os`]: vars_os
110
106
///
111
107
/// # Examples
112
108
///
@@ -222,7 +218,7 @@ fn _var(key: &OsStr) -> Result<String, VarError> {
222
218
/// Fetches the environment variable `key` from the current process, returning
223
219
/// [`None`] if the variable isn't set.
224
220
///
225
- /// [`None`]: ../option/enum. Option.html#variant. None
221
+ /// [`None`]: Option:: None
226
222
///
227
223
/// # Panics
228
224
///
@@ -254,7 +250,7 @@ fn _var_os(key: &OsStr) -> Option<OsString> {
254
250
/// The error type for operations interacting with environment variables.
255
251
/// Possibly returned from the [`env::var`] function.
256
252
///
257
- /// [`env::var`]: fn. var.html
253
+ /// [`env::var`]: var
258
254
#[ derive( Debug , PartialEq , Eq , Clone ) ]
259
255
#[ stable( feature = "env" , since = "1.0.0" ) ]
260
256
pub enum VarError {
@@ -382,8 +378,7 @@ fn _remove_var(k: &OsStr) {
382
378
/// This structure is created by the [`std::env::split_paths`] function. See its
383
379
/// documentation for more.
384
380
///
385
- /// [`PathBuf`]: ../../std/path/struct.PathBuf.html
386
- /// [`std::env::split_paths`]: fn.split_paths.html
381
+ /// [`std::env::split_paths`]: split_paths
387
382
#[ stable( feature = "env" , since = "1.0.0" ) ]
388
383
pub struct SplitPaths < ' a > {
389
384
inner : os_imp:: SplitPaths < ' a > ,
@@ -410,8 +405,6 @@ pub struct SplitPaths<'a> {
410
405
/// None => println!("{} is not defined in the environment.", key)
411
406
/// }
412
407
/// ```
413
- ///
414
- /// [`PathBuf`]: ../../std/path/struct.PathBuf.html
415
408
#[ stable( feature = "env" , since = "1.0.0" ) ]
416
409
pub fn split_paths < T : AsRef < OsStr > + ?Sized > ( unparsed : & T ) -> SplitPaths < ' _ > {
417
410
SplitPaths { inner : os_imp:: split_paths ( unparsed. as_ref ( ) ) }
@@ -438,7 +431,7 @@ impl fmt::Debug for SplitPaths<'_> {
438
431
/// The error type for operations on the `PATH` variable. Possibly returned from
439
432
/// the [`env::join_paths`] function.
440
433
///
441
- /// [`env::join_paths`]: fn. join_paths.html
434
+ /// [`env::join_paths`]: join_paths
442
435
#[ derive( Debug ) ]
443
436
#[ stable( feature = "env" , since = "1.0.0" ) ]
444
437
pub struct JoinPathsError {
@@ -450,13 +443,11 @@ pub struct JoinPathsError {
450
443
///
451
444
/// # Errors
452
445
///
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
454
447
/// [`Path`]s contains an invalid character for constructing the `PATH`
455
448
/// variable (a double quote on Windows or a colon on Unix).
456
449
///
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
460
451
///
461
452
/// # Examples
462
453
///
@@ -508,7 +499,7 @@ pub struct JoinPathsError {
508
499
/// }
509
500
/// ```
510
501
///
511
- /// [`env::split_paths`]: fn. split_paths.html
502
+ /// [`env::split_paths`]: split_paths
512
503
#[ stable( feature = "env" , since = "1.0.0" ) ]
513
504
pub fn join_paths < I , T > ( paths : I ) -> Result < OsString , JoinPathsError >
514
505
where
@@ -688,8 +679,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
688
679
/// set to arbitrary text, and may not even exist. This means this property
689
680
/// should not be relied upon for security purposes.
690
681
///
691
- /// [`String`]: ../string/struct.String.html
692
- /// [`std::env::args`]: ./fn.args.html
682
+ /// [`std::env::args`]: args
693
683
#[ stable( feature = "env" , since = "1.0.0" ) ]
694
684
pub struct Args {
695
685
inner : ArgsOs ,
@@ -705,8 +695,7 @@ pub struct Args {
705
695
/// set to arbitrary text, and may not even exist. This means this property
706
696
/// should not be relied upon for security purposes.
707
697
///
708
- /// [`OsString`]: ../ffi/struct.OsString.html
709
- /// [`std::env::args_os`]: ./fn.args_os.html
698
+ /// [`std::env::args_os`]: args_os
710
699
#[ stable( feature = "env" , since = "1.0.0" ) ]
711
700
pub struct ArgsOs {
712
701
inner : sys:: args:: Args ,
@@ -744,8 +733,6 @@ pub struct ArgsOs {
744
733
/// println!("{}", argument);
745
734
/// }
746
735
/// ```
747
- ///
748
- /// [`args_os`]: ./fn.args_os.html
749
736
#[ stable( feature = "env" , since = "1.0.0" ) ]
750
737
pub fn args ( ) -> Args {
751
738
Args { inner : args_os ( ) }
0 commit comments