@@ -207,7 +207,7 @@ pub async fn dns_basic() {
207
207
let mut resolver = builder. build ( target, opts) ;
208
208
209
209
// Wait for schedule work to be called.
210
- let _ = work_rx. recv ( ) . await . unwrap ( ) ;
210
+ work_rx. recv ( ) . await . unwrap ( ) ;
211
211
let ( update_tx, mut update_rx) = mpsc:: unbounded_channel ( ) ;
212
212
let mut channel_controller = FakeChannelController {
213
213
update_tx,
@@ -216,7 +216,7 @@ pub async fn dns_basic() {
216
216
resolver. work ( & mut channel_controller) ;
217
217
// A successful endpoint update should be received.
218
218
let update = update_rx. recv ( ) . await . unwrap ( ) ;
219
- assert_eq ! ( update. endpoints. unwrap( ) . len( ) > 1 , true ) ;
219
+ assert ! ( update. endpoints. unwrap( ) . len( ) > 1 ) ;
220
220
}
221
221
222
222
#[ tokio:: test]
@@ -236,7 +236,7 @@ pub async fn invalid_target() {
236
236
let mut resolver = builder. build ( target, opts) ;
237
237
238
238
// Wait for schedule work to be called.
239
- let _ = work_rx. recv ( ) . await . unwrap ( ) ;
239
+ work_rx. recv ( ) . await . unwrap ( ) ;
240
240
let ( update_tx, mut update_rx) = mpsc:: unbounded_channel ( ) ;
241
241
let mut channel_controller = FakeChannelController {
242
242
update_tx,
@@ -245,14 +245,11 @@ pub async fn invalid_target() {
245
245
resolver. work ( & mut channel_controller) ;
246
246
// An error endpoint update should be received.
247
247
let update = update_rx. recv ( ) . await . unwrap ( ) ;
248
- assert_eq ! (
249
- update
250
- . endpoints
251
- . err( )
252
- . unwrap( )
253
- . contains( & target. to_string( ) ) ,
254
- true
255
- ) ;
248
+ assert ! ( update
249
+ . endpoints
250
+ . err( )
251
+ . unwrap( )
252
+ . contains( & target. to_string( ) ) ) ;
256
253
}
257
254
258
255
#[ derive( Clone ) ]
@@ -319,7 +316,7 @@ pub async fn dns_lookup_error() {
319
316
let mut resolver = builder. build ( target, opts) ;
320
317
321
318
// Wait for schedule work to be called.
322
- let _ = work_rx. recv ( ) . await . unwrap ( ) ;
319
+ work_rx. recv ( ) . await . unwrap ( ) ;
323
320
let ( update_tx, mut update_rx) = mpsc:: unbounded_channel ( ) ;
324
321
let mut channel_controller = FakeChannelController {
325
322
update_tx,
@@ -328,7 +325,7 @@ pub async fn dns_lookup_error() {
328
325
resolver. work ( & mut channel_controller) ;
329
326
// An error endpoint update should be received.
330
327
let update = update_rx. recv ( ) . await . unwrap ( ) ;
331
- assert_eq ! ( update. endpoints. err( ) . unwrap( ) . contains( "test_error" ) , true ) ;
328
+ assert ! ( update. endpoints. err( ) . unwrap( ) . contains( "test_error" ) ) ;
332
329
}
333
330
334
331
#[ tokio:: test]
@@ -360,7 +357,7 @@ pub async fn dns_lookup_timeout() {
360
357
let mut resolver = DnsResolver :: new ( Box :: new ( dns_client) , opts, dns_opts) ;
361
358
362
359
// Wait for schedule work to be called.
363
- let _ = work_rx. recv ( ) . await . unwrap ( ) ;
360
+ work_rx. recv ( ) . await . unwrap ( ) ;
364
361
let ( update_tx, mut update_rx) = mpsc:: unbounded_channel ( ) ;
365
362
let mut channel_controller = FakeChannelController {
366
363
update_tx,
@@ -370,7 +367,7 @@ pub async fn dns_lookup_timeout() {
370
367
371
368
// An error endpoint update should be received.
372
369
let update = update_rx. recv ( ) . await . unwrap ( ) ;
373
- assert_eq ! ( update. endpoints. err( ) . unwrap( ) . contains( "Timed out" ) , true ) ;
370
+ assert ! ( update. endpoints. err( ) . unwrap( ) . contains( "Timed out" ) ) ;
374
371
}
375
372
376
373
#[ tokio:: test]
@@ -398,7 +395,7 @@ pub async fn rate_limit() {
398
395
let mut resolver = DnsResolver :: new ( dns_client, opts, dns_opts) ;
399
396
400
397
// Wait for schedule work to be called.
401
- let event = work_rx. recv ( ) . await . unwrap ( ) ;
398
+ work_rx. recv ( ) . await . unwrap ( ) ;
402
399
let ( update_tx, mut update_rx) = mpsc:: unbounded_channel ( ) ;
403
400
let mut channel_controller = FakeChannelController {
404
401
update_tx,
@@ -407,14 +404,14 @@ pub async fn rate_limit() {
407
404
resolver. work ( & mut channel_controller) ;
408
405
// A successful endpoint update should be received.
409
406
let update = update_rx. recv ( ) . await . unwrap ( ) ;
410
- assert_eq ! ( update. endpoints. unwrap( ) . len( ) > 1 , true ) ;
407
+ assert ! ( update. endpoints. unwrap( ) . len( ) > 1 ) ;
411
408
412
409
// Call resolve_now repeatedly, new updates should not be produced.
413
410
for _ in 0 ..5 {
414
411
resolver. resolve_now ( ) ;
415
412
tokio:: select! {
416
413
_ = work_rx. recv( ) => {
417
- panic!( "Received unexpected work request from resolver: {:?}" , event ) ;
414
+ panic!( "Received unexpected work request from resolver" ) ;
418
415
}
419
416
_ = tokio:: time:: sleep( DEFAULT_TEST_SHORT_TIMEOUT ) => {
420
417
println!( "No work requested from resolver." ) ;
@@ -448,7 +445,7 @@ pub async fn re_resolution_after_success() {
448
445
let mut resolver = DnsResolver :: new ( dns_client, opts, dns_opts) ;
449
446
450
447
// Wait for schedule work to be called.
451
- let _ = work_rx. recv ( ) . await . unwrap ( ) ;
448
+ work_rx. recv ( ) . await . unwrap ( ) ;
452
449
let ( update_tx, mut update_rx) = mpsc:: unbounded_channel ( ) ;
453
450
let mut channel_controller = FakeChannelController {
454
451
update_tx,
@@ -457,14 +454,14 @@ pub async fn re_resolution_after_success() {
457
454
resolver. work ( & mut channel_controller) ;
458
455
// A successful endpoint update should be received.
459
456
let update = update_rx. recv ( ) . await . unwrap ( ) ;
460
- assert_eq ! ( update. endpoints. unwrap( ) . len( ) > 1 , true ) ;
457
+ assert ! ( update. endpoints. unwrap( ) . len( ) > 1 ) ;
461
458
462
459
// Call resolve_now, a new update should be produced.
463
460
resolver. resolve_now ( ) ;
464
- let _ = work_rx. recv ( ) . await . unwrap ( ) ;
461
+ work_rx. recv ( ) . await . unwrap ( ) ;
465
462
resolver. work ( & mut channel_controller) ;
466
463
let update = update_rx. recv ( ) . await . unwrap ( ) ;
467
- assert_eq ! ( update. endpoints. unwrap( ) . len( ) > 1 , true ) ;
464
+ assert ! ( update. endpoints. unwrap( ) . len( ) > 1 ) ;
468
465
}
469
466
470
467
#[ tokio:: test]
@@ -507,18 +504,18 @@ pub async fn backoff_on_error() {
507
504
// As the channel returned an error to the resolver, the resolver will
508
505
// backoff and re-attempt resolution.
509
506
for _ in 0 ..5 {
510
- let _ = work_rx. recv ( ) . await . unwrap ( ) ;
507
+ work_rx. recv ( ) . await . unwrap ( ) ;
511
508
resolver. work ( & mut channel_controller) ;
512
509
let update = update_rx. recv ( ) . await . unwrap ( ) ;
513
- assert_eq ! ( update. endpoints. unwrap( ) . len( ) > 1 , true ) ;
510
+ assert ! ( update. endpoints. unwrap( ) . len( ) > 1 ) ;
514
511
}
515
512
516
513
// This time the channel accepts the resolver update.
517
514
channel_controller. update_result = Ok ( ( ) ) ;
518
- let _ = work_rx. recv ( ) . await . unwrap ( ) ;
515
+ work_rx. recv ( ) . await . unwrap ( ) ;
519
516
resolver. work ( & mut channel_controller) ;
520
517
let update = update_rx. recv ( ) . await . unwrap ( ) ;
521
- assert_eq ! ( update. endpoints. unwrap( ) . len( ) > 1 , true ) ;
518
+ assert ! ( update. endpoints. unwrap( ) . len( ) > 1 ) ;
522
519
523
520
// Since the channel controller returns Ok(), the resolver will stop
524
521
// producing more updates.
0 commit comments