From 00006b3cc2530e004fd16372cafb5ddb59f7bc6a Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Thu, 5 Dec 2024 00:26:13 +0000 Subject: [PATCH] Expand home_dir docs --- std/src/env.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/std/src/env.rs b/std/src/env.rs index 043747d0bc5e3..535236ff89a37 100644 --- a/std/src/env.rs +++ b/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