1
Fork 0

Add doc alias for chdir to std::env::set_current_dir

Searching for `chdir` in the Rust documentation produces no useful
results.
This commit is contained in:
Josh Triplett 2021-04-29 12:41:23 -07:00
parent 814a560072
commit c185f08e46

View file

@ -61,6 +61,7 @@ pub fn current_dir() -> io::Result<PathBuf> {
/// assert!(env::set_current_dir(&root).is_ok()); /// assert!(env::set_current_dir(&root).is_ok());
/// println!("Successfully changed working directory to {}!", root.display()); /// println!("Successfully changed working directory to {}!", root.display());
/// ``` /// ```
#[doc(alias = "chdir")]
#[stable(feature = "env", since = "1.0.0")] #[stable(feature = "env", since = "1.0.0")]
pub fn set_current_dir<P: AsRef<Path>>(path: P) -> io::Result<()> { pub fn set_current_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
os_imp::chdir(path.as_ref()) os_imp::chdir(path.as_ref())