Skip to content
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

fs: implement AsRaw{Fd,Handle} for tokio::fs::File (#1364) #1640

Closed
wants to merge 1 commit into from

Conversation

Xinkai
Copy link
Contributor

@Xinkai Xinkai commented Oct 7, 2019

Motivation

Exposing tokio::fs RawFd/RawHandle

Solution

Moved file.rs to file/mod.rs to get around mod visibility issue.


impl AsRawFd for File {
fn as_raw_fd(&self) -> RawFd {
let std = self.std.clone();
Copy link
Member

Choose a reason for hiding this comment

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

Why is the clone required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. It doesn't need a clone() here. I must be thinking about something else.

Moved file.rs to file/mod.rs to get around mod visibility issue.
@carllerche
Copy link
Member

Ah woops. I never circled back here. #1827 added this.

However, #1827 does not include tests. Would you be willing to update the PR to apply the tests to master?

Again, sorry for duplicating work.

@Xinkai
Copy link
Contributor Author

Xinkai commented Nov 30, 2019

It's also my bad to lose track of this issue, as I have been busy moving from one city to another.

I will continue working on this (implement tests) when I am done with the rest of the moving routine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants