From 22a24c98d3429f9e98e4ce5d096f58620d753458 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 3 Feb 2022 23:19:36 +0100 Subject: [PATCH] Add missing platform-specific information on current_dir and set_current_dir --- library/std/src/env.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/library/std/src/env.rs b/library/std/src/env.rs index c06928647d389..5ed9fa9d6f0fd 100644 --- a/library/std/src/env.rs +++ b/library/std/src/env.rs @@ -23,6 +23,11 @@ use crate::sys::os as os_imp; /// Returns the current working directory as a [`PathBuf`]. /// +/// # Platform-specific behavior +/// +/// This function currently corresponds to the `getcwd` function on Unix +/// and the `GetCurrentDirectoryW` function on Windows. +/// /// # Errors /// /// Returns an [`Err`] if the current working directory value is invalid. @@ -49,6 +54,11 @@ pub fn current_dir() -> io::Result { /// Changes the current working directory to the specified path. /// +/// # Platform-specific behavior +/// +/// This function currently corresponds to the `chdir` function on Unix +/// and the `SetCurrentDirectoryW` function on Windows. +/// /// Returns an [`Err`] if the operation fails. /// /// # Examples