mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
Clarify the behavior of std::env::home_dir
and std::env::temp_dir
This concern was raised by #28940.
This commit is contained in:
parent
9d3e79ad37
commit
8667aa207b
@ -416,7 +416,10 @@ impl Error for JoinPathsError {
|
|||||||
/// Returns the value of the 'HOME' environment variable if it is
|
/// Returns the value of the 'HOME' environment variable if it is
|
||||||
/// set and not equal to the empty string. Otherwise, returns the value of the
|
/// set and not equal to the empty string. Otherwise, returns the value of the
|
||||||
/// 'USERPROFILE' environment variable if it is set and not equal to the empty
|
/// 'USERPROFILE' environment variable if it is set and not equal to the empty
|
||||||
/// string.
|
/// string. If both do not exist, [`GetUserProfileDirectory`][msdn] is used to
|
||||||
|
/// return the appropriate path.
|
||||||
|
///
|
||||||
|
/// [msdn]: https://msdn.microsoft.com/en-us/library/windows/desktop/bb762280(v=vs.85).aspx
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
@ -442,7 +445,11 @@ pub fn home_dir() -> Option<PathBuf> {
|
|||||||
///
|
///
|
||||||
/// On Windows, returns the value of, in order, the 'TMP', 'TEMP',
|
/// On Windows, returns the value of, in order, the 'TMP', 'TEMP',
|
||||||
/// 'USERPROFILE' environment variable if any are set and not the empty
|
/// 'USERPROFILE' environment variable if any are set and not the empty
|
||||||
/// string. Otherwise, tmpdir returns the path to the Windows directory.
|
/// string. Otherwise, tmpdir returns the path to the Windows directory. This
|
||||||
|
/// behavior is identical to that of [GetTempPath][msdn], which this function
|
||||||
|
/// uses internally.
|
||||||
|
///
|
||||||
|
/// [msdn]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa364992(v=vs.85).aspx
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::env;
|
/// use std::env;
|
||||||
|
Loading…
Reference in New Issue
Block a user