File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33#![ allow( unsafe_code) ]
44
5- use core:: num:: NonZeroI32 ;
5+ use core:: { fmt , num:: NonZeroI32 } ;
66
77/// A process identifier as a raw integer.
88pub type RawPid = i32 ;
@@ -87,6 +87,12 @@ impl Pid {
8787 }
8888}
8989
90+ impl fmt:: Display for Pid {
91+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
92+ write ! ( f, "{}" , self . 0 )
93+ }
94+ }
95+
9096#[ cfg( test) ]
9197mod tests {
9298 use super :: * ;
Original file line number Diff line number Diff line change 11//! User and Group ID types.
22
3+ use core:: fmt;
4+
35use crate :: backend:: c;
46use crate :: ffi;
57
@@ -86,6 +88,18 @@ impl Gid {
8688 }
8789}
8890
91+ impl fmt:: Display for Uid {
92+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
93+ write ! ( f, "{}" , self . 0 )
94+ }
95+ }
96+
97+ impl fmt:: Display for Gid {
98+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
99+ write ! ( f, "{}" , self . 0 )
100+ }
101+ }
102+
89103// Return the raw value of the IDs. In case of `None` it returns `!0` since it
90104// has the same bit pattern as `-1` indicating no change to the owner/group ID.
91105pub ( crate ) fn translate_fchown_args (
You can’t perform that action at this time.
0 commit comments