Skip to content

Commit 22a24c9

Browse files
Add missing platform-specific information on current_dir and set_current_dir
1 parent a00e130 commit 22a24c9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

library/std/src/env.rs

+10
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ use crate::sys::os as os_imp;
2323

2424
/// Returns the current working directory as a [`PathBuf`].
2525
///
26+
/// # Platform-specific behavior
27+
///
28+
/// This function currently corresponds to the `getcwd` function on Unix
29+
/// and the `GetCurrentDirectoryW` function on Windows.
30+
///
2631
/// # Errors
2732
///
2833
/// Returns an [`Err`] if the current working directory value is invalid.
@@ -49,6 +54,11 @@ pub fn current_dir() -> io::Result<PathBuf> {
4954

5055
/// Changes the current working directory to the specified path.
5156
///
57+
/// # Platform-specific behavior
58+
///
59+
/// This function currently corresponds to the `chdir` function on Unix
60+
/// and the `SetCurrentDirectoryW` function on Windows.
61+
///
5262
/// Returns an [`Err`] if the operation fails.
5363
///
5464
/// # Examples

0 commit comments

Comments
 (0)