Skip to content

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

Merged
bors merged 2 commits into
rust-lang:masterfrom
jackpot51:patch-3
Jul 14, 2017
Merged

Implement fs::rename in sys::redox#43204
bors merged 2 commits into
rust-lang:masterfrom
jackpot51:patch-3

Conversation

@jackpot51

Copy link
Copy Markdown
Contributor

This uses a simple implementation of copy + unlink. Redox does not have a rename or link system call for a faster implementation.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

Comment threadsrc/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<()> {

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

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

unimplemented!();
copy(old, new)?;
unlink(old)?;
Ok(())

Copy link
Copy Markdown
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)

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+ rollup

@bors

bors commented Jul 13, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit 4259ae6 has been approved by alexcrichton

@jackpot51

Copy link
Copy Markdown
ContributorAuthor

Thanks!

@alexcrichtonalexcrichton added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jul 13, 2017
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Jul 13, 2017
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.
bors added a commit that referenced this pull request Jul 14, 2017
Rollup of 7 pull requests
- Successful merges: #42926, #43125, #43157, #43167, #43187, #43203, #43204
- Failed merges:
@bors
bors merged commit 4259ae6 into rust-lang:masterJul 14, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@jackpot51@rust-highfive@alexcrichton@bors@durka@codyps