Skip to content

Commit

Permalink
Rollup merge of #97379 - ear7h:master, r=thomcc
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Dylan-DPC authored May 25, 2022
2 parents 02c0c76 + 84c80e7 commit 70bdfc1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions library/std/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 70bdfc1

Please sign in to comment.