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,9 +28,6 @@ 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
36
- ///
37
31
/// # Examples
38
32
///
39
33
/// ```
@@ -54,8 +48,6 @@ pub fn current_dir() -> io::Result<PathBuf> {
54
48
///
55
49
/// Returns an [`Err`] if the operation fails.
56
50
///
57
- /// [`Err`]: ../../std/result/enum.Result.html#method.err
58
- ///
59
51
/// # Examples
60
52
///
61
53
/// ```
@@ -76,7 +68,7 @@ pub fn set_current_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
76
68
/// This structure is created by the [`std::env::vars`] function. See its
77
69
/// documentation for more.
78
70
///
79
- /// [`std::env::vars`]: fn. vars.html
71
+ /// [`std::env::vars`]: vars
80
72
#[ stable( feature = "env" , since = "1.0.0" ) ]
81
73
pub struct Vars {
82
74
inner : VarsOs ,
@@ -87,7 +79,7 @@ pub struct Vars {
87
79
/// This structure is created by the [`std::env::vars_os`] function. See
88
80
/// its documentation for more.
89
81
///
90
- /// [`std::env::vars_os`]: fn. vars_os.html
82
+ /// [`std::env::vars_os`]: vars_os
91
83
#[ stable( feature = "env" , since = "1.0.0" ) ]
92
84
pub struct VarsOs {
93
85
inner : os_imp:: Env ,
@@ -106,7 +98,7 @@ pub struct VarsOs {
106
98
/// environment is not valid unicode. If this is not desired, consider using the
107
99
/// [`env::vars_os`] function.
108
100
///
109
- /// [`env::vars_os`]: fn. vars_os.html
101
+ /// [`env::vars_os`]: vars_os
110
102
///
111
103
/// # Examples
112
104
///
@@ -222,8 +214,6 @@ fn _var(key: &OsStr) -> Result<String, VarError> {
222
214
/// Fetches the environment variable `key` from the current process, returning
223
215
/// [`None`] if the variable isn't set.
224
216
///
225
- /// [`None`]: ../option/enum.Option.html#variant.None
226
- ///
227
217
/// # Panics
228
218
///
229
219
/// This function may panic if `key` is empty, contains an ASCII equals sign
@@ -254,7 +244,7 @@ fn _var_os(key: &OsStr) -> Option<OsString> {
254
244
/// The error type for operations interacting with environment variables.
255
245
/// Possibly returned from the [`env::var`] function.
256
246
///
257
- /// [`env::var`]: fn. var.html
247
+ /// [`env::var`]: var
258
248
#[ derive( Debug , PartialEq , Eq , Clone ) ]
259
249
#[ stable( feature = "env" , since = "1.0.0" ) ]
260
250
pub enum VarError {
@@ -382,8 +372,7 @@ fn _remove_var(k: &OsStr) {
382
372
/// This structure is created by the [`std::env::split_paths`] function. See its
383
373
/// documentation for more.
384
374
///
385
- /// [`PathBuf`]: ../../std/path/struct.PathBuf.html
386
- /// [`std::env::split_paths`]: fn.split_paths.html
375
+ /// [`std::env::split_paths`]: split_paths
387
376
#[ stable( feature = "env" , since = "1.0.0" ) ]
388
377
pub struct SplitPaths < ' a > {
389
378
inner : os_imp:: SplitPaths < ' a > ,
@@ -410,8 +399,6 @@ pub struct SplitPaths<'a> {
410
399
/// None => println!("{} is not defined in the environment.", key)
411
400
/// }
412
401
/// ```
413
- ///
414
- /// [`PathBuf`]: ../../std/path/struct.PathBuf.html
415
402
#[ stable( feature = "env" , since = "1.0.0" ) ]
416
403
pub fn split_paths < T : AsRef < OsStr > + ?Sized > ( unparsed : & T ) -> SplitPaths < ' _ > {
417
404
SplitPaths { inner : os_imp:: split_paths ( unparsed. as_ref ( ) ) }
@@ -438,7 +425,7 @@ impl fmt::Debug for SplitPaths<'_> {
438
425
/// The error type for operations on the `PATH` variable. Possibly returned from
439
426
/// the [`env::join_paths`] function.
440
427
///
441
- /// [`env::join_paths`]: fn. join_paths.html
428
+ /// [`env::join_paths`]: join_paths
442
429
#[ derive( Debug ) ]
443
430
#[ stable( feature = "env" , since = "1.0.0" ) ]
444
431
pub struct JoinPathsError {
@@ -450,14 +437,10 @@ pub struct JoinPathsError {
450
437
///
451
438
/// # Errors
452
439
///
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
454
441
/// [`Path`]s contains an invalid character for constructing the `PATH`
455
442
/// variable (a double quote on Windows or a colon on Unix).
456
443
///
457
- /// [`Path`]: ../../std/path/struct.Path.html
458
- /// [`OsString`]: ../../std/ffi/struct.OsString.html
459
- /// [err]: ../../std/result/enum.Result.html#variant.Err
460
- ///
461
444
/// # Examples
462
445
///
463
446
/// Joining paths on a Unix-like platform:
@@ -508,7 +491,7 @@ pub struct JoinPathsError {
508
491
/// }
509
492
/// ```
510
493
///
511
- /// [`env::split_paths`]: fn. split_paths.html
494
+ /// [`env::split_paths`]: split_paths
512
495
#[ stable( feature = "env" , since = "1.0.0" ) ]
513
496
pub fn join_paths < I , T > ( paths : I ) -> Result < OsString , JoinPathsError >
514
497
where
@@ -688,8 +671,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
688
671
/// set to arbitrary text, and may not even exist. This means this property
689
672
/// should not be relied upon for security purposes.
690
673
///
691
- /// [`String`]: ../string/struct.String.html
692
- /// [`std::env::args`]: ./fn.args.html
674
+ /// [`std::env::args`]: args
693
675
#[ stable( feature = "env" , since = "1.0.0" ) ]
694
676
pub struct Args {
695
677
inner : ArgsOs ,
@@ -705,8 +687,7 @@ pub struct Args {
705
687
/// set to arbitrary text, and may not even exist. This means this property
706
688
/// should not be relied upon for security purposes.
707
689
///
708
- /// [`OsString`]: ../ffi/struct.OsString.html
709
- /// [`std::env::args_os`]: ./fn.args_os.html
690
+ /// [`std::env::args_os`]: args_os
710
691
#[ stable( feature = "env" , since = "1.0.0" ) ]
711
692
pub struct ArgsOs {
712
693
inner : sys:: args:: Args ,
@@ -744,8 +725,6 @@ pub struct ArgsOs {
744
725
/// println!("{}", argument);
745
726
/// }
746
727
/// ```
747
- ///
748
- /// [`args_os`]: ./fn.args_os.html
749
728
#[ stable( feature = "env" , since = "1.0.0" ) ]
750
729
pub fn args ( ) -> Args {
751
730
Args { inner : args_os ( ) }
0 commit comments