@@ -166,10 +166,7 @@ mod tests {
166
166
process_id : 0 ,
167
167
reason : "reason" . to_string ( ) ,
168
168
} ;
169
- assert_eq ! (
170
- format!( "{}" , error) ,
171
- "Invalid process id: 0. Reason: reason"
172
- ) ;
169
+ assert_eq ! ( format!( "{error}" ) , "Invalid process id: 0. Reason: reason" ) ;
173
170
}
174
171
175
172
#[ test]
@@ -179,7 +176,7 @@ mod tests {
179
176
source : u32:: try_from ( -1 ) . unwrap_err ( ) ,
180
177
} ;
181
178
assert_eq ! (
182
- format!( "{}" , error ) ,
179
+ format!( "{error}" ) ,
183
180
"Invalid cast. Reason: reason. Source: out of range integral type conversion attempted"
184
181
) ;
185
182
}
@@ -193,23 +190,23 @@ mod tests {
193
190
source : Some ( "source" . parse :: < u32 > ( ) . unwrap_err ( ) ) ,
194
191
} ;
195
192
assert_eq ! (
196
- format!( "{}" , error ) ,
193
+ format!( "{error}" ) ,
197
194
"Invalid proc entry. Process id: 0. Path: /proc/0. Reason: reason. Source: Some(ParseIntError { kind: InvalidDigit })"
198
195
) ;
199
196
}
200
197
201
198
#[ test]
202
199
fn error_display_io ( ) {
203
200
let error = Error :: Io ( std:: io:: Error :: new ( std:: io:: ErrorKind :: Other , "error" ) ) ;
204
- assert_eq ! ( format!( "{}" , error ) , "I/O error: error" ) ;
201
+ assert_eq ! ( format!( "{error}" ) , "I/O error: error" ) ;
205
202
}
206
203
207
204
#[ cfg( windows) ]
208
205
#[ test]
209
206
fn error_display_windows ( ) {
210
207
let error = Error :: Windows ( windows:: core:: Error :: OK ) ;
211
208
assert_eq ! (
212
- format!( "{}" , error ) ,
209
+ format!( "{error}" ) ,
213
210
"Windows error: The operation completed successfully. (0x00000000)"
214
211
) ;
215
212
}
@@ -218,14 +215,14 @@ mod tests {
218
215
#[ test]
219
216
fn error_display_unix ( ) {
220
217
let error = Error :: Unix ( nix:: Error :: UnsupportedOperation ) ;
221
- assert_eq ! ( format!( "{}" , error ) , "Unix error: UnsupportedOperation" ) ;
218
+ assert_eq ! ( format!( "{error}" ) , "Unix error: UnsupportedOperation" ) ;
222
219
}
223
220
224
221
#[ test]
225
222
fn from_io_error ( ) {
226
223
let error = std:: io:: Error :: new ( std:: io:: ErrorKind :: Other , "error" ) ;
227
224
let error = Error :: from ( error) ;
228
- assert_eq ! ( format!( "{}" , error ) , "I/O error: error" ) ;
225
+ assert_eq ! ( format!( "{error}" ) , "I/O error: error" ) ;
229
226
}
230
227
231
228
#[ cfg( windows) ]
@@ -234,7 +231,7 @@ mod tests {
234
231
let error = windows:: core:: Error :: OK ;
235
232
let error = Error :: from ( error) ;
236
233
assert_eq ! (
237
- format!( "{}" , error ) ,
234
+ format!( "{error}" ) ,
238
235
"Windows error: The operation completed successfully. (0x00000000)"
239
236
) ;
240
237
}
@@ -244,13 +241,13 @@ mod tests {
244
241
fn from_unix_error ( ) {
245
242
let error = nix:: Error :: UnsupportedOperation ;
246
243
let error = Error :: from ( error) ;
247
- assert_eq ! ( format!( "{}" , error ) , "Unix error: UnsupportedOperation" ) ;
244
+ assert_eq ! ( format!( "{error}" ) , "Unix error: UnsupportedOperation" ) ;
248
245
}
249
246
250
247
#[ test]
251
248
fn default_config ( ) {
252
249
let config = Config :: default ( ) ;
253
250
assert_eq ! ( config. signal, "SIGTERM" ) ;
254
- assert_eq ! ( config. include_target, true ) ;
251
+ assert ! ( config. include_target) ;
255
252
}
256
253
}
0 commit comments