Skip to content

Commit c74ede8

Browse files
committed
Expand home_dir docs
1 parent acabb52 commit c74ede8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: library/std/src/env.rs

+7
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,13 @@ impl Error for JoinPathsError {
597597

598598
/// Returns the path of the current user's home directory if known.
599599
///
600+
/// This may return `None` if getting the directory fails or if the platform does not have user home directories.
601+
///
602+
/// For storing user data and configuration it is often preferable to use more specific directories.
603+
/// For example, [XDG Base Directories] on Unix or the `LOCALAPPDATA` and `APPDATA` environment variables on Windows.
604+
///
605+
/// [XDG Base Directories]: https://specifications.freedesktop.org/basedir-spec/latest/
606+
///
600607
/// # Unix
601608
///
602609
/// - Returns the value of the 'HOME' environment variable if it is set

0 commit comments

Comments
 (0)