File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
99- Added ` aio_writev ` and ` aio_readv ` .
1010 (#[ 1713] ( https://github.com/nix-rust/nix/pull/1713 ) )
1111
12+ - impl ` From<uid_t> ` for ` Uid ` and ` From<gid_t> ` for ` Gid `
13+ (#[ 1727] ( https://github.com/nix-rust/nix/pull/1727 ) )
1214- impl From<SockaddrIn > for std::net::SocketAddrV4 and
1315 impl From<SockaddrIn6 > for std::net::SocketAddrV6.
1416 (#[ 1711] ( https://github.com/nix-rust/nix/pull/1711 ) )
Original file line number Diff line number Diff 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+
9096impl fmt:: Display for Uid {
9197 fn fmt( & self , f: & mut fmt:: Formatter ) -> fmt:: Result {
9298 fmt:: Display :: fmt( & self . 0 , f)
@@ -131,6 +137,12 @@ impl From<Gid> for gid_t {
131137 }
132138}
133139
140+ impl From <gid_t> for Gid {
141+ fn from( gid: gid_t) -> Self {
142+ Gid ( gid)
143+ }
144+ }
145+
134146impl fmt:: Display for Gid {
135147 fn fmt( & self , f: & mut fmt:: Formatter ) -> fmt:: Result {
136148 fmt:: Display :: fmt( & self . 0 , f)
You can’t perform that action at this time.
0 commit comments