Skip to content

Commit c553a6f

Browse files
committed
Add infallible conversion gid_t -> Gid
1 parent beb4259 commit c553a6f

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
@@ -137,6 +137,12 @@ impl From<Gid> for gid_t {
137137
}
138138
}
139139

140+
impl From<gid_t> for Gid {
141+
fn from(gid: gid_t) -> Self {
142+
Gid(gid)
143+
}
144+
}
145+
140146
impl fmt::Display for Gid {
141147
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
142148
fmt::Display::fmt(&self.0, f)

0 commit comments

Comments
 (0)