Skip to content

Commit beb4259

Browse files
committed
Add infallible conversion uid_t -> Uid
1 parent b0ab557 commit beb4259

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/unistd.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ impl From<Uid> for uid_t {
8787
}
8888
}
8989

90+
impl From<uid_t> for Uid {
91+
fn from(uid: uid_t) -> Self {
92+
Uid(uid)
93+
}
94+
}
95+
9096
impl fmt::Display for Uid {
9197
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
9298
fmt::Display::fmt(&self.0, f)

0 commit comments

Comments
 (0)