-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Function to convert OpenOptions to c_int #76110
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Function to convert OpenOptions to c_int #76110
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
I would like some guidance on the following:
|
Co-authored-by: Ivan Tham <pickfire@riseup.net>
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.
I added a couple of comments.
Also, you should add tests near the existing tests for OpenOptionsExt.
Thanks a lot for your comments! I've added the as_flags method to I currently have one last issue, I cannot seem to find the location of the tests for |
Similar to the other methods of
I'd suggest adding doctests to the method, like the other methods of |
…ust into convert-openoptions-cint
r? @joshtriplett |
📌 Commit 2f51922 has been approved by |
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit 2f51922 has been approved by |
☀️ Test successful - checks-actions, checks-azure |
…tions-cint, r=dtolnay Revert "Function to convert OpenOptions to c_int" Reverts rust-lang#76110. This broke Rust's stability guarantees. Closes rust-lang#77089. r? `@joshtriplett`
Fixes: #74943
The creation_mode and access_mode function were already available in the OpenOptions struct, but currently private. I've added a new free functions to unix/fs.rs which takes the OpenOptions, and returns the c_int to be used as parameter for the
open
call.