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

Fixed implementation of conversion to std::fs::File #7

Merged
merged 1 commit into from
Sep 7, 2023
Merged

Fixed implementation of conversion to std::fs::File #7

merged 1 commit into from
Sep 7, 2023

Conversation

michaelvanstraten
Copy link
Contributor

@michaelvanstraten michaelvanstraten commented Sep 6, 2023

The current implementation of the From trait for PipeReader and PipeWriter for std::fs::File is wrong, resulting in a invalid handle error whenever trying to use the produced file.

Rust makes it kind of hard to see why this is wrong, but I added a comment to explain the issue.

@zhiburt
Copy link
Owner

zhiburt commented Sep 7, 2023

Hi @michaelvanstraten

Good catch indeed;

Drop of PipeReader/PipeWriter is called before we return a file and we close File Handle because of.

Thanks.
Take care.

@zhiburt zhiburt merged commit 755f559 into zhiburt:master Sep 7, 2023
@ekzhang ekzhang mentioned this pull request Sep 8, 2024
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.

2 participants