Skip to content

Implement fs::rename in sys::redox #43204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 14, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/libstd/sys/redox/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,9 @@ pub fn unlink(p: &Path) -> io::Result<()> {
}

pub fn rename(_old: &Path, _new: &Path) -> io::Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you forgot to rename the arguments

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the reminder @durka

::sys_common::util::dumb_print(format_args!("Rename\n"));
unimplemented!();
copy(old, new)?;
unlink(old)?;
Ok(())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 2 proceeding lines could be reduced to unlink(old)

}

pub fn set_perm(p: &Path, perm: FilePermissions) -> io::Result<()> {
Expand Down