Rollup merge of #43204 - jackpot51:patch-3, r=alexcrichton

Implement fs::rename in sys::redox

This uses a simple implementation of copy + unlink. Redox does not have a rename or link system call for a faster implementation.
This commit is contained in:
Steve Klabnik 2017-07-13 10:45:22 -04:00 committed by GitHub
commit da3f5b80ed

View file

@ -383,9 +383,10 @@ pub fn unlink(p: &Path) -> io::Result<()> {
Ok(())
}
pub fn rename(_old: &Path, _new: &Path) -> io::Result<()> {
::sys_common::util::dumb_print(format_args!("Rename\n"));
unimplemented!();
pub fn rename(old: &Path, new: &Path) -> io::Result<()> {
copy(old, new)?;
unlink(old)?;
Ok(())
}
pub fn set_perm(p: &Path, perm: FilePermissions) -> io::Result<()> {