about summary refs log tree commit diff
path: root/library/std/src/env.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/std/src/env.rs')
-rw-r--r--library/std/src/env.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/library/std/src/env.rs b/library/std/src/env.rs
index 043747d0bc5..535236ff89a 100644
--- a/library/std/src/env.rs
+++ b/library/std/src/env.rs
@@ -597,6 +597,13 @@ impl Error for JoinPathsError {
 
 /// Returns the path of the current user's home directory if known.
 ///
+/// This may return `None` if getting the directory fails or if the platform does not have user home directories.
+///
+/// For storing user data and configuration it is often preferable to use more specific directories.
+/// For example, [XDG Base Directories] on Unix or the `LOCALAPPDATA` and `APPDATA` environment variables on Windows.
+///
+/// [XDG Base Directories]: https://specifications.freedesktop.org/basedir-spec/latest/
+///
 /// # Unix
 ///
 /// - Returns the value of the 'HOME' environment variable if it is set