@@ -99,58 +99,59 @@ impl fmt::Debug for Command {
99
99
}
100
100
}
101
101
102
- pub struct ExitStatus ( !) ;
102
+ #[ derive( PartialEq , Eq , Clone , Copy , Debug ) ]
103
+ #[ non_exhaustive]
104
+ pub struct ExitStatus ( ) ;
103
105
104
106
impl ExitStatus {
105
107
pub fn exit_ok ( & self ) -> Result < ( ) , ExitStatusError > {
106
- self . 0
108
+ Ok ( ( ) )
107
109
}
108
110
109
111
pub fn code ( & self ) -> Option < i32 > {
110
- self . 0
112
+ Some ( 0 )
111
113
}
112
114
}
113
115
114
- impl Clone for ExitStatus {
115
- fn clone ( & self ) -> ExitStatus {
116
- self . 0
116
+ impl fmt :: Display for ExitStatus {
117
+ fn fmt ( & self , f : & mut fmt :: Formatter < ' _ > ) -> fmt :: Result {
118
+ write ! ( f , "<dummy exit status>" )
117
119
}
118
120
}
119
121
120
- impl Copy for ExitStatus { }
122
+ pub struct ExitStatusError ( ! ) ;
121
123
122
- impl PartialEq for ExitStatus {
123
- fn eq ( & self , _other : & ExitStatus ) -> bool {
124
+ impl Clone for ExitStatusError {
125
+ fn clone ( & self ) -> ExitStatusError {
124
126
self . 0
125
127
}
126
128
}
127
129
128
- impl Eq for ExitStatus { }
130
+ impl Copy for ExitStatusError { }
129
131
130
- impl fmt :: Debug for ExitStatus {
131
- fn fmt ( & self , _f : & mut fmt :: Formatter < ' _ > ) -> fmt :: Result {
132
+ impl PartialEq for ExitStatusError {
133
+ fn eq ( & self , _other : & ExitStatusError ) -> bool {
132
134
self . 0
133
135
}
134
136
}
135
137
136
- impl fmt:: Display for ExitStatus {
138
+ impl Eq for ExitStatusError { }
139
+
140
+ impl fmt:: Debug for ExitStatusError {
137
141
fn fmt ( & self , _f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
138
142
self . 0
139
143
}
140
144
}
141
145
142
- #[ derive( PartialEq , Eq , Clone , Copy , Debug ) ]
143
- pub struct ExitStatusError ( ExitStatus ) ;
144
-
145
146
impl Into < ExitStatus > for ExitStatusError {
146
147
fn into ( self ) -> ExitStatus {
147
- self . 0 . 0
148
+ self . 0
148
149
}
149
150
}
150
151
151
152
impl ExitStatusError {
152
153
pub fn code ( self ) -> Option < NonZeroI32 > {
153
- self . 0 . 0
154
+ self . 0
154
155
}
155
156
}
156
157
0 commit comments