Rollup merge of #97379 - ear7h:master, r=thomcc

Add aliases for `current_dir`

Aliases were added for the equivalent C/C++ APIs for POSIX and Windows. Also, I added one for `pwd` which users may be more familiar with, from the command line.
This commit is contained in:
Dylan DPC 2022-05-25 07:31:45 +02:00 committed by GitHub
commit 70bdfc1d79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,6 +49,9 @@ use crate::sys::os as os_imp;
/// Ok(())
/// }
/// ```
#[doc(alias = "pwd")]
#[doc(alias = "getcwd")]
#[doc(alias = "GetCurrentDirectory")]
#[stable(feature = "env", since = "1.0.0")]
pub fn current_dir() -> io::Result<PathBuf> {
os_imp::getcwd()