Skip to content

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

Merged
bors[bot] merged 1 commit intonix-rust:masterfrom
vkkoskie:from-uidt
May 30, 2022
Merged

Add From<uid_t> and From<gid_t>#1727
bors[bot] merged 1 commit intonix-rust:masterfrom
vkkoskie:from-uidt

Conversation

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

Comment thread CHANGELOG.md Outdated
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

All comments addressed. Good to go.

@rtzoeller
Copy link
Copy Markdown
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.

2 participants