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

Add From<uid_t> and From<gid_t> #1727

Merged
merged 1 commit into from May 30, 2022
Merged

Add From<uid_t> and From<gid_t> #1727

merged 1 commit into from May 30, 2022

Conversation

vkkoskie
Copy link
Contributor

Conversions to/from primitive uid_t and gid_t to newtype Uid and Gid types are valid and infallible, but are only implemented in one direction. This provides the counterparts in the other direction.

These conversions are identical in behavior to the from_raw methods. However, using the more idiomatic From trait enables easier interoperability with other crates (e.g., deserialization with serde)

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@rtzoeller rtzoeller left a comment

Choose a reason for hiding this comment

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

Thanks! Can you address a minor CHANGELOG nitpick and then squash everything into one commit?

Implements the following traits:
* From<uid_t> for Uid
* From<gid_t> for Gid
@vkkoskie
Copy link
Contributor Author

All comments addressed. Good to go.

@rtzoeller
Copy link
Collaborator

bors r+

@bors bors bot merged commit 7e8757f into nix-rust:master May 30, 2022
@vkkoskie vkkoskie deleted the from-uidt branch May 30, 2022 23:12
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