-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Implement fs::rename in sys::redox #43204
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
src/libstd/sys/redox/fs.rs
Outdated
@@ -384,8 +384,9 @@ pub fn unlink(p: &Path) -> io::Result<()> { | |||
} | |||
|
|||
pub fn rename(_old: &Path, _new: &Path) -> io::Result<()> { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
src/libstd/sys/redox/fs.rs
Outdated
unimplemented!(); | ||
copy(old, new)?; | ||
unlink(old)?; | ||
Ok(()) |
There was a problem hiding this comment.
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)
@bors: r+ rollup |
📌 Commit 4259ae6 has been approved by |
Thanks! |
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 uses a simple implementation of copy + unlink. Redox does not have a rename or link system call for a faster implementation.