File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
#![ allow( unsafe_code) ]
4
4
5
- use core:: num:: NonZeroI32 ;
5
+ use core:: { fmt , num:: NonZeroI32 } ;
6
6
7
7
/// A process identifier as a raw integer.
8
8
pub type RawPid = i32 ;
@@ -87,6 +87,12 @@ impl Pid {
87
87
}
88
88
}
89
89
90
+ impl fmt:: Display for Pid {
91
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
92
+ write ! ( f, "{}" , self . 0 )
93
+ }
94
+ }
95
+
90
96
#[ cfg( test) ]
91
97
mod tests {
92
98
use super :: * ;
Original file line number Diff line number Diff line change 1
1
//! User and Group ID types.
2
2
3
+ use core:: fmt;
4
+
3
5
use crate :: backend:: c;
4
6
use crate :: ffi;
5
7
@@ -86,6 +88,18 @@ impl Gid {
86
88
}
87
89
}
88
90
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
+
89
103
// Return the raw value of the IDs. In case of `None` it returns `!0` since it
90
104
// has the same bit pattern as `-1` indicating no change to the owner/group ID.
91
105
pub ( crate ) fn translate_fchown_args (
You can’t perform that action at this time.
0 commit comments